I'm trying to do a document search application using Elastic search(NEST client)[I'm indexing the word documents as an attachment as of now].
I would like to know if there is way to do an auto fill feature using ES.
Something like "As in when i type some text in search text box, it start returning results based on that few text. Similar to google."
if I'm not wrong , ngrams are used for a different purpose.
for eg: lets say I'm indexing a word elastic, then it will index as e,el,ela,elas,elast,elasti, elastic. So when I try to search "el" it will give me this result. Isnt it?
But my purpose is to only suggest the as I type the keyword and on search button click, it should find as per the search query and the keyword. Can ngrams be used in this case also?
indeed. But once you get the 1st 10 more relevant documents, you can extract from their _source any field you want and display it to the user?
Or run an aggregation on a given non analyzed field and display that to the user?
Thanks david. But I'm already using "english" analyzer on the attachment's content field. So can this(ngram) be joined along with it? (like separate index analyzer and search analyzer).. I presume this one (the english analyzer is search analyzer in this case)
thanks for the info david.. Yeah if im using ngrams i will be using it on title field where as english analyzer on the content field while search. does that make sense? am i thinking in the right direction?
Yes. But again (I think I already wrote that), using mapper attachments is not the ideal thing to do.
I definitely prefer:
Doing the extraction in my application with Tika, create the JSON document exactly as I want, apply analyzers, multifield, copy_to, whatever feature you want.
or
Wait for 5.0 and use ingest-attachment plugin.
mapper-attachments plugin will be removed in the future, probably in 5.1 or 6.0.
It's already marked as deprecated.
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.