Please sign in to comment.
Changed Article mapping so that we can search & facet against author …
…names Based on previous refactoring, we're now addding a specific mapping for the `author` property, so that it's analyzed as "multi field" property. This means it's: 1. Split into tokens the usual way search engine works, with the snowball analyzer. 2. Left "as is", without any modification, as an "exact" sub-property. This illustrates one of the usual use-cases for multi field properties: you want to search against them as usual, but you also want to use their literal, unmodified value for aggregations. This allows us to get rid of database calls (`Author.find(facet['term'])`) in the view layer, and use information already in the index for displaying the faceted navigation sidebar. Notice we facet against the `author.name.exact` field, and that we have changed the mechanics of limiting results based on user's choice in right-hand sidebar: instead of query, we are using filter, again on the `author.name.exact` field. This means, the **query** is used to limit the results, but **faceted navigation** still displays the distribution of results among authors, when you limit the results to a specific author, because a **filter** is used; facets are bound only by queries, not filters. See <http://www.elasticsearch.org/guide/reference/api/search/facets/index.html> for more information.
- Loading branch information...
Showing with 11 additions and 7 deletions.