I have this indexed property
Quote:
@Column(name = "ITEM_CODE")
@NotNull
@Field(index = Index.UN_TOKENIZED, store = Store.YES)
public String getItemCode() {
return this.itemCode;
}
and 2 other fields which are tokenized.
Itemcode will have unique values with no spaces like DSCH2, RMAV3000 etc
and this query in my search method.
Code:
String searchQuery = this.itemKeyFields ;
String[] itemFields = {"itemCode", "modelName","modelDescription"};
Map<String,Float> boostPerField = new HashMap<String,Float>(3);
boostPerField.put( "itemCode", 4f);
boostPerField.put( "modelName", 2f);
boostPerField.put( "modelDescription", 2f);
QueryParser parser =
new MultiFieldQueryParser( itemFields, new StandardAnalyzer(), boostPerField );
With this setup, if I put dsc as a search keyword, I get no results, but if I put in dsc*, I get my desired results because it does a wildcard card search.
My question is should my itemcode field be tokenized too?
If I do that, I would get my results but is it the right way for field like this.
Other than that, the speed of Hibernate Search is phenomenal !!!
Thanks
Franco