Example #1
0
 /**
  * Shortcut notation to easily get an index from the search service.
  *
  * <pre><code>
  *     def index = search.index("books")
  * </code></pre>
  *
  * @param search the search service
  * @param indexName the name of the index
  * @return an index
  */
 public static Index index(SearchService search, String indexName) {
   return search.getIndex(IndexSpec.newBuilder().setName(indexName).build());
 }
 /** Extension point allowing the Index implementation to be modified */
 protected Index getIndex() {
   SearchService searchService = SearchServiceFactory.getSearchService();
   return searchService.getIndex(IndexSpec.newBuilder().setName(indexName));
 }