org.springframework.data.solr.repository.Query Java Examples

The following examples show how to use org.springframework.data.solr.repository.Query. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProductRepository.java    From tools-journey with Apache License 2.0 4 votes vote down vote up
@Query("select u from Product u.id = ?0")
public List<Product> findById(String id);
 
Example #2
Source File: ProductRepository.java    From tools-journey with Apache License 2.0 4 votes vote down vote up
@Query("id:*?0* OR name:*?0*")
public Page<Product> findByCustomQuery(String searchTerm, Pageable pageable);
 
Example #3
Source File: ProductRepository.java    From tools-journey with Apache License 2.0 4 votes vote down vote up
@Query(name = "Product.findByNamedQuery")
public Page<Product> findByNamedQuery(String searchTerm, Pageable pageable);
 
Example #4
Source File: ProductRepository.java    From tutorials with MIT License 4 votes vote down vote up
@Query("id:*?0* OR name:*?0*")
public Page<Product> findByCustomQuery(String searchTerm, Pageable pageable);
 
Example #5
Source File: ProductRepository.java    From tutorials with MIT License 4 votes vote down vote up
@Query(name = "Product.findByNamedQuery")
public Page<Product> findByNamedQuery(String searchTerm, Pageable pageable);
 
Example #6
Source File: BookRepository.java    From Spring-data-solr-example with Apache License 2.0 4 votes vote down vote up
@Query("name:?0")
@Facet(fields = { "categories_txt" }, limit = 5)
FacetPage<Book> findByNameAndFacetOnCategories(String name, Pageable page);
 
Example #7
Source File: ProductRepository.java    From spring-data-solr-showcase with Apache License 2.0 4 votes vote down vote up
@Highlight(prefix = "<b>", postfix = "</b>")
@Query(fields = { SearchableProductDefinition.ID_FIELD_NAME, SearchableProductDefinition.NAME_FIELD_NAME,
		SearchableProductDefinition.PRICE_FIELD_NAME, SearchableProductDefinition.FEATURES_FIELD_NAME,
		SearchableProductDefinition.AVAILABLE_FIELD_NAME }, defaultOperator = Operator.AND)
HighlightPage<Product> findByNameIn(Collection<String> names, Pageable page);
 
Example #8
Source File: ProductRepository.java    From spring-data-examples with Apache License 2.0 2 votes vote down vote up
/**
 * Find the first 10 documents with a match in name or description. Boosting score for search hits in name by 2 sorts
 * documents by relevance.
 *
 * @param name
 * @param description
 * @return
 */
@Query
List<Product> findTop10ByNameOrDescription(@Boost(2) String name, String description);