0
votes

I just started with Elastic search and have to work using nest client. I have few queries regarding the design of index. Can someone help me in answering them.

  1. Is it possible to do a global search across different types? for eg: I have forum posts, wiki pages and Blog pages in my web site. So when I search for a word,can I do a global search across these three and generate results. How can I index the documents to achieve this? (Best example: Google search. search for elastic, it shows results across web pages, images , videos etc)

  2. I was reading the documentation for auto complete and came across another function context suggester. What is the difference between these two? From the documentation it is clear that autocompletion is something like suggesting and filling the word as we type(based on the analyzers we use) where as in context suggester we have predefine the suggestions. Is my understanding correct? But I didnt understand in which context do we use autocomplete and context suggester.

  3. Are there any other resources apart from elastic guide to start with nest ?

Sorry for the very generic questions (as I said, I'm completely new to Elastic search). Don't know if I can even ask these questions here.

Thanks in advance.

1
For your question3, I think the best answer will be checking out the official guide , SO and elasticforum for your queries. - ASN

1 Answers

3
votes
  1. Yes, it is possible to perform a global search across different types in both the same index and different indices.

    It's generally recommended to have only one type per index (unless you have a good reason not too e.g. parent/child relationship between documents, hierarchical inheritance relationship between types in application). Think of a type like a predefined filter. Much functionality works at the index level e.g. completion suggester, document field types, so having separate indices mitigates some potential causes of confusion, and deleting an entire index when documents therein are no longer needed is a fast operation (in comparison to deleting many documents in an index you want to keep).

  2. Completion suggester and Context suggester are great for scenarios where you need to provide "completion as you type". They are extremely fast due to the Finite State Transducer (FST) data structure that they use; basically only paths of the graph that follow from the current node (typed character) need be evaluated to provide suggestions.

    Because these two suggesters use an FST, you don't have the ability to use query DSL filters as you would with a search that uses the inverted index data structure. The Context Suggester is essentially an extension of Completion suggester that provides some filtering in the form of categories (an array of terms) or a geolocation that is associated with the completion data.

    Often it is useful to use a suggester in conjunction with other search approaches to form an overall strategy.

  3. The Elasticsearch Definitive Guide Online is a great resource to start with, written by two members of Elastic and updated in line with new releases. Other resources that you may find pragmatically useful are Elasticsearch in Action and Relevant Search. Check out the NEST documentation for getting started, and if you have questions, the discussion forums are probably the best place to ask as a wide number of people at Elastic as well as the wider IR/Search community frequent them.