9/18/2023 0 Comments Full text search![]() Let's index some documents and define keywords to be highlighted: itemSearchService.index("hm0001", "Brand1 Washing Machine", "Home Appliances", 100f) This will be very helpful to get a better picture of the results. We may want the keywords in our search query to be highlighted in the results. What's more, if we want to search on specific fields instead of all indexed fields, we can specify these in the query: tQuery("description:Brand* AND category:*Washing*") 4.2. Solr queries also support boolean operators like in SQL: tQuery("brand1 AND (Washing OR Refrigerator)") Īll boolean operators must be in all caps those backed by the query parser are AND, OR, NOT, + and –. We can use wildcard characters * and ? in our query: tQuery("*rand?") ![]() We want to search any word containing “rand”, that starts with any number of characters and ends with only one character. Note that simple searches are not case sensitive. The search query above will look for any documents that contain the complete word “brand1” in any of its indexed fields. The number of returned records will be 10, indexed from zero when start and rows are not specified. SolrJ will internally use the main query parameter q in its request to the server. List items = response.getBeans(Item.class) ![]() QueryResponse response = solrClient.query(query)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |