We are running a search app for book. It is implemented by hibernate search.
Book entity is defined as following:
@Entity
@Indexed
public class Book{
@DocumentId
private Integer UID;
@Field
private String title;
@Field
private String description;
...}
If a user search book name, say, they input Microsoft access 2007, books with title or description contains microsoft, access or 2007 returned. That is what we expected. Some of books are totally unrelated because of keyword 2007. I am looking for a solution to understand importance of each keywords. In that case, 2007 is less important in search. But for that search, there is no difference for microsoft, access or 2007.
The second user case: Is there a good analyzer that can use in indexing and querying to support multiple phrases? I thought the default analyzer of hibernate search just tokenize search words into single word?
If search words is microsoft access 2007, results have best score if they contains "microsoft access",
the other search example: "salt lake city", "united states", results are not expected if only match salt, city or lake or at least, they should be behind results with "salt lake city".
Can anyone offer me some clues?
thanks!