Posts

Showing posts with the label elasticsearch

Is it mandatory to create POCO objects for all Indexes I intend to search with ElasticSearch?

Is it mandatory to create POCO objects for all Indexes I intend to search with ElasticSearch? I'm starting with ElasticSearch.NET (trying Nest first). A very basic question: all the search API methods I see (search, get, etc) require specifying a .NET type. Isn't there a way to specify an index name so the API infers the response type automatically ? In other words, is it mandatory to create POCO objects for all Indexes we intend to search ? (I understand from the documentation that ElasticSearch can infer a document type from an index by using the structure of the first document...) I believe the answer is no with Nest's high level wrapper. Seems this was its whole purpose: to provide a strongly typed wrapper to interact with the database. Using the low level api, though, one does not need to provide a POCO .net target type. – Veverke Jul 1 at 11:00 ...