Open clemsos opened 9 years ago
Elasticsearch has a built-in feature to parse queries called query_string
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax
The right feature to expose to user is match
or multimatch
http://www.elasticsearch.org/guide/reference/query-dsl/multi-match-query.html
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-match-query.html
Custom parser should support chinese input quotes.
NB: you have to use some western characters input (english, german, french) to make the quotes work : "". The quote used when you input Chinese (for instance sogou or google pinyin) are not equivalent (“”). I am working on a fix for this but it is tricky. Sorry for the annoyance, Chinese input make things more complicated sometimes.
Input should allow more operator like "" and AND and OR to parse search query.
ex.
普京 returns 10310 results (wrong) it should accept "普京"
The query syntax is Lucene a JS parser is available here https://github.com/thoward/lucene-query-parser.js