Different search term on different fields using edismax query parser in solr
up vote
0
down vote
favorite
I have a solr query that searches on multiple fields. To increase the recall, I also do wildcard and fuzzy query. I use edismax query parser because I also have to use boost function.
Here is the relevant parts of the query:
defType=edismax&q= (wine AND company) OR (wine* AND company*)^0.5 OR (wine* OR company*)^0.01 OR (wine~1 AND company~1)^0.02&qf=primary_tags^1 secondary_tags_s^0.2 merchant_name_s^0.5
Now, the above query searches for (wine AND company) OR (wine* AND company*)^0.5 OR (wine* OR company*)^0.01 OR (wine~1 AND company~1)^0.02
on all the fields primary_tags^1 secondary_tags_s^0.2 merchant_name_s^0.5
, but what I want is that (wine AND company)
should only be searched on merchant_name_s^0.5
, (wine* AND company*)^0.5 OR (wine* OR company*)^0.01
on primary_tags^1
and (wine~1 AND company~1)^0.02
on secondary_tags_s^0.2
.
What would be the correct way to achieve that?
solr edismax
add a comment |
up vote
0
down vote
favorite
I have a solr query that searches on multiple fields. To increase the recall, I also do wildcard and fuzzy query. I use edismax query parser because I also have to use boost function.
Here is the relevant parts of the query:
defType=edismax&q= (wine AND company) OR (wine* AND company*)^0.5 OR (wine* OR company*)^0.01 OR (wine~1 AND company~1)^0.02&qf=primary_tags^1 secondary_tags_s^0.2 merchant_name_s^0.5
Now, the above query searches for (wine AND company) OR (wine* AND company*)^0.5 OR (wine* OR company*)^0.01 OR (wine~1 AND company~1)^0.02
on all the fields primary_tags^1 secondary_tags_s^0.2 merchant_name_s^0.5
, but what I want is that (wine AND company)
should only be searched on merchant_name_s^0.5
, (wine* AND company*)^0.5 OR (wine* OR company*)^0.01
on primary_tags^1
and (wine~1 AND company~1)^0.02
on secondary_tags_s^0.2
.
What would be the correct way to achieve that?
solr edismax
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a solr query that searches on multiple fields. To increase the recall, I also do wildcard and fuzzy query. I use edismax query parser because I also have to use boost function.
Here is the relevant parts of the query:
defType=edismax&q= (wine AND company) OR (wine* AND company*)^0.5 OR (wine* OR company*)^0.01 OR (wine~1 AND company~1)^0.02&qf=primary_tags^1 secondary_tags_s^0.2 merchant_name_s^0.5
Now, the above query searches for (wine AND company) OR (wine* AND company*)^0.5 OR (wine* OR company*)^0.01 OR (wine~1 AND company~1)^0.02
on all the fields primary_tags^1 secondary_tags_s^0.2 merchant_name_s^0.5
, but what I want is that (wine AND company)
should only be searched on merchant_name_s^0.5
, (wine* AND company*)^0.5 OR (wine* OR company*)^0.01
on primary_tags^1
and (wine~1 AND company~1)^0.02
on secondary_tags_s^0.2
.
What would be the correct way to achieve that?
solr edismax
I have a solr query that searches on multiple fields. To increase the recall, I also do wildcard and fuzzy query. I use edismax query parser because I also have to use boost function.
Here is the relevant parts of the query:
defType=edismax&q= (wine AND company) OR (wine* AND company*)^0.5 OR (wine* OR company*)^0.01 OR (wine~1 AND company~1)^0.02&qf=primary_tags^1 secondary_tags_s^0.2 merchant_name_s^0.5
Now, the above query searches for (wine AND company) OR (wine* AND company*)^0.5 OR (wine* OR company*)^0.01 OR (wine~1 AND company~1)^0.02
on all the fields primary_tags^1 secondary_tags_s^0.2 merchant_name_s^0.5
, but what I want is that (wine AND company)
should only be searched on merchant_name_s^0.5
, (wine* AND company*)^0.5 OR (wine* OR company*)^0.01
on primary_tags^1
and (wine~1 AND company~1)^0.02
on secondary_tags_s^0.2
.
What would be the correct way to achieve that?
solr edismax
solr edismax
asked 22 hours ago
vishalaksh
65921228
65921228
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
edismax supports the full Lucene syntax.
q=merchant_name:(wine AND company)^0.5 primary_tags:(wine* AND company*)^0.5 primary_tags:(wine* OR company*)^0.01 secondary_tags_s:(wine~1 AND company~1)^0.0004
should be about the same query you've described. I've combined the secondary_tags_s
part into one single weight and seprated the primary_tags
clauses, since the default behavior is OR
between the terms anyway (depending on q.op
).
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
edismax supports the full Lucene syntax.
q=merchant_name:(wine AND company)^0.5 primary_tags:(wine* AND company*)^0.5 primary_tags:(wine* OR company*)^0.01 secondary_tags_s:(wine~1 AND company~1)^0.0004
should be about the same query you've described. I've combined the secondary_tags_s
part into one single weight and seprated the primary_tags
clauses, since the default behavior is OR
between the terms anyway (depending on q.op
).
add a comment |
up vote
0
down vote
edismax supports the full Lucene syntax.
q=merchant_name:(wine AND company)^0.5 primary_tags:(wine* AND company*)^0.5 primary_tags:(wine* OR company*)^0.01 secondary_tags_s:(wine~1 AND company~1)^0.0004
should be about the same query you've described. I've combined the secondary_tags_s
part into one single weight and seprated the primary_tags
clauses, since the default behavior is OR
between the terms anyway (depending on q.op
).
add a comment |
up vote
0
down vote
up vote
0
down vote
edismax supports the full Lucene syntax.
q=merchant_name:(wine AND company)^0.5 primary_tags:(wine* AND company*)^0.5 primary_tags:(wine* OR company*)^0.01 secondary_tags_s:(wine~1 AND company~1)^0.0004
should be about the same query you've described. I've combined the secondary_tags_s
part into one single weight and seprated the primary_tags
clauses, since the default behavior is OR
between the terms anyway (depending on q.op
).
edismax supports the full Lucene syntax.
q=merchant_name:(wine AND company)^0.5 primary_tags:(wine* AND company*)^0.5 primary_tags:(wine* OR company*)^0.01 secondary_tags_s:(wine~1 AND company~1)^0.0004
should be about the same query you've described. I've combined the secondary_tags_s
part into one single weight and seprated the primary_tags
clauses, since the default behavior is OR
between the terms anyway (depending on q.op
).
answered 22 hours ago
MatsLindh
24.2k22240
24.2k22240
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53371028%2fdifferent-search-term-on-different-fields-using-edismax-query-parser-in-solr%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown