Reputation: 92130
Can someone please tell me what is the difference between:
q=word1 word2
and
q="word1 word2"
I'm trying to match a keyword "word1 word2" (yes, my keyword can have whitespaces) that is analyzed with KeywordTokenizerFactory
and it seems it only works when I add the quotes in the query.
By the way I use Solr extended Dismax, don't know if this matters. The syntax is then:
q="some text"&qf=KeywordField&qf=FrenchtextField
Edit:
The problem I have with quotes is that I have another field that contains fulltexte (analysis is basic and close to FrenchAnalyzer, including a lowercase filter)
I have 'HelloWorld' text indexed, and I can find it back with q=helloWoRLD but not with q="helloWoRLD": this unit test is broken since I added quotes in all my queries. I don't understand what is the difference between q=helloWoRLD and q="helloWoRLD" since it would still be 1 term search right?
Upvotes: 0
Views: 192
Reputation: 8570
Lucene query syntax uses spaces to separate terms so you are performing a search for "word1" in the field "q" and "word2" but with no specified field (I'm not sure how lucene behaves when no field is specified).
I don't quite follow your hello world problem so can't comment on that. Hope this helps
Upvotes: 1