couchdb-lucene icon indicating copy to clipboard operation
couchdb-lucene copied to clipboard

Query wrapped in double quotes disables wildcard search

Open nnarhinen opened this issue 12 years ago • 1 comments

A search query like

?include_docs=true&limit=100&default_operator=AND&q=renova*%20kytkin*&debug=true

produces:

"analyzer": "class org.apache.lucene.analysis.standard.StandardAnalyzer",
"etag": "1dde3b58c453e3",
"fetch_duration": 41,
"limit": 100,
"plan": "BooleanQuery(+PrefixQuery(default:renova,boost=1.0)+PrefixQuery(default:kytkin,boost=1.0),boost=1.0)",
"q": "+default:renova* +default:kytkin*",

but if each search term is wrapped in double quotes, like

?include_docs=true&limit=100&default_operator=AND&q=%22renova*%22%20%22kytkin*%22&debug=true

the result is

"analyzer": "class org.apache.lucene.analysis.standard.StandardAnalyzer",
"etag": "1dde3b58c453e3",
"fetch_duration": 42,
"limit": 100,
"plan": "BooleanQuery(+TermQuery(default:renova,boost=1.0)+TermQuery(default:kytkin,boost=1.0),boost=1.0)",
"q": "+default:renova +default:kytkin",

sot it isn't doing a prefixquery. I find this unintuitive.

nnarhinen avatar May 14 '12 11:05 nnarhinen

Hmm.. is it so that we would have to use ComplexPhraseQueryParser to achive what I'd like to have.

And if so, would it break existing functionality?

nnarhinen avatar May 15 '12 22:05 nnarhinen