The search analyzer is assigned in the schema. So in theory, it can find
the document, right?
So do you mean the search analyzer cannot be applied automatically in this
case ? But I had make sure some other case will do apply the search
analyzer.
cheers,
Ivan
Binh Ly於 2014年3月27日星期四UTC+8下午9時34分39秒寫道:
The term query is really what you want, but if you need the query_string
query, you can always override the search analyzer at query time:
Since your search_analyzer is standard, it will tokenize your query string
as standard (i.e. it will break it down), then it will match it against the
path_hierarchy tokens in the index which will not match. Since you indexed
as path_hierarchy and you want to search using an exact match, then you can
either use terms, or use the same exact analyzer (path_hierarchy) at query
time.
You can always do a bool query with the term part in 1 clause, and the
query_string part in another clause if that's what you need.
I did not notice the standard analyzer will also split "/". Thanks a lot.
Binh Ly於 2014年3月27日星期四UTC+8下午11時24分34秒寫道:
Since your search_analyzer is standard, it will tokenize your query string
as standard (i.e. it will break it down), then it will match it against the
path_hierarchy tokens in the index which will not match. Since you indexed
as path_hierarchy and you want to search using an exact match, then you can
either use terms, or use the same exact analyzer (path_hierarchy) at query
time.
You can always do a bool query with the term part in 1 clause, and the
query_string part in another clause if that's what you need.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.