[hibernate-dev] Similarity approach in Hibernate Search

Emmanuel Bernard emmanuel at hibernate.org
Thu May 7 17:51:13 EDT 2009


On  May 7, 2009, at 18:38, Sanne Grinovero wrote:

> Each time a new Document is added to the index,
> the similarity relevant to that entity is looked up from the
> pertaining documentBuilder
> and set to the indexwriter:
>
> AddWorkDelegate:
>
> Similarity similarity = documentBuilder.getSimilarity();
> writer.setSimilarity( similarity );
> writer.addDocument( work.getDocument(), analyzer );
>
> So the analyzer is scoped per document, the similarity is globally set
> on the indexwriter.
> Does this make sense to update the similarity for each add operation  
> type?
>
> This is a problem as I can't use two (more) threads to add documents  
> to
> the same index.
>
> Is there a good use case for which someone might need a different
> Similarity implementation
> for different entities contained in the same index?
> I'd like to change that to an "illegal configuration".

+1



More information about the hibernate-dev mailing list