I'm using Solr 5.5 and I have problem that I'm hoping to find a solution here.
I have a field that I've created using the below setting:
<field name="exactName_noAlias_en_US" type="text_exact_query_tokenized" indexed="true" stored="false"/>
<fieldtype name="text_exact_query_tokenized" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.ASCIIFoldingFilterFactory" preserveOriginal="true"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.ASCIIFoldingFilterFactory" preserveOriginal="true"/>
<filter class="solr.ShingleFilterFactory" maxShingleSize="10"/>
</analyzer>
</fieldtype>
This field can have value like: "Justin Bieber"
And my expectation is as follows:
For a query "The artist Justin Bieber is a teen heartthrob", I'd like it to match this document. And queries like "An artist named Bieber Justin is canadian" or "The name Justin is so common" aren't supposed to find a match.
I see that using the default '/select' request handler isn't finding the match when I issue a query "Justin Bieber" even though it is an exact match. But a different field was set as the default field for the '/select' RH, so, I tried to create another RH using the below curl:
curl http://localhost/solr/performer/config -H 'Content-type:application/json' -d '{"add-requesthandler" : {"name": "/exactName","class":"solr.SearchHandler","defaults":{ "echoParams":"explicit" ,"rows":10, "df":"exactName_noAlias_en_US", "q.op":"AND" },"useParams":"x"}}'
It created the RH I wanted but my query still didn't match the required document.
Kindly suggest a solution to this problem.
Here is a screenshot from the Analysis screen.
Below is a snippet of the 'debug' section of the response for query : "/exactName?q=exactName_noAlias_en_US:Justin%20Bieber&wt=json&indent=true&debug=true"
"debug":{
"rawquerystring":"exactName_noAlias_en_US:Justin Bieber",
"querystring":"exactName_noAlias_en_US:Justin Bieber",
"parsedquery":"+exactName_noAlias_en_US:justin +exactName_noAlias_en_US:bieber",
"parsedquery_toString":"+exactName_noAlias_en_US:justin +exactName_noAlias_en_US:bieber",
"explain":{},
And below is the snippet of the 'debug' section of the response for query : "/select?q=exactName_noAlias_en_US:Justin%20Bieber&wt=json&indent=true&debug=true"
"debug":{
"rawquerystring":"exactName_noAlias_en_US:Justin Bieber",
"querystring":"exactName_noAlias_en_US:Justin Bieber",
"parsedquery":"+exactName_noAlias_en_US:justin +searchKeywords_en_US:bieber",
"parsedquery_toString":"+exactName_noAlias_en_US:justin +searchKeywords_en_US:bieber",
"explain":{},
And below is the snippet of the 'debug' section of the response for the phrase query with /select RH: "/select?q=exactName_noAlias_en_US:"Justin%20Bieber"&wt=json&indent=true&debug=true
"debug":{
"rawquerystring":"exactName_noAlias_en_US:\"Justin Bieber\"",
"querystring":"exactName_noAlias_en_US:\"Justin Bieber\"",
"parsedquery":"MultiPhraseQuery(exactName_noAlias_en_US:\"(justin justin bieber) bieber\")",
"parsedquery_toString":"exactName_noAlias_en_US:\"(justin justin bieber) bieber\"",
"explain":{},
And below is the snippet of the 'debug' section of the response for the phrase query with /exactName RH: "/exactName?q=exactName_noAlias_en_US:"Justin%20Bieber"&wt=json&indent=true&debug=true
"debug":{
"rawquerystring":"exactName_noAlias_en_US:\"Justin Bieber\"",
"querystring":"exactName_noAlias_en_US:\"Justin Bieber\"",
"parsedquery":"MultiPhraseQuery(exactName_noAlias_en_US:\"(justin justin bieber) bieber\")",
"parsedquery_toString":"exactName_noAlias_en_US:\"(justin justin bieber) bieber\"",
"explain":{},
Below is the query and the corresponding debug section with the whitespace in the query escaped:
select?q=Justin\ Beiber&df=exactName_noAlias_en_US
Debug:
"rawquerystring":"Justin\\ Beiber",
"querystring":"Justin\\ Beiber",
"parsedquery":"+((exactName_noAlias_en_US:justin exactName_noAlias_en_US:justin beiber)/no_coord) +exactName_noAlias_en_US:beiber",
"parsedquery_toString":"+(exactName_noAlias_en_US:justin exactName_noAlias_en_US:justin beiber) +exactName_noAlias_en_US:beiber",
"explain":{},