Files
Spring Operator e0ef48eb78 #474 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 320 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
2019-03-22 08:00:34 +01:00
..
2019-03-22 08:00:34 +01:00
2019-03-20 10:11:16 -05:00

Spring Data MongoDB - Text Search Examples

This project contains samples of text search specific features of Spring Data Mongodb.

Support for Text Index

Define text index structures manually (like below) or use @TextIndexed to mark content to be indexed for full text search.

TextIndexDefinition textIndex = new TextIndexDefinitionBuilder()
  .onField("title", 3F)
  .onField("content", 2F)
  .onField("categories")
  .build();

template.indexOps(BlogPost.class).ensureIndex(textIndex);

Support for full text repository queries

Use derived finder methods to search for terms and phrases.

interface BlogPostRepository extends CrudRepository<BlogPost, String> {

    // page through results for full text query
	Page<BlogPost> findBy(TextCriteria criteria, Pageable page);

    // find all matching documents and sort by relevance
	List<BlogPost> findAllByOrderByScoreDesc(TextCriteria criteria);
}