lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Similarity class
Date Mon, 24 Nov 2003 18:21:09 GMT
On Monday, November 24, 2003, at 12:22  PM, Ralf B wrote:
> One question:
>
> The similarity class is abstract. Are there default implementations 
> like in
> other parts of this API (Analysers for example) available and how can 
> I use
> it i.e. to calculate weights? Are there some default implementations 
> hidden in
> other classes (i.e. in Hits) to calculate the term weighting. Does 
> somebody
> have some code which demonstrates the usage?

Well, nothing is "hidden" when you have a nice IDE :))

In IntelliJ, I did this:

- Ctrl-n, typed "simi" followed by return, which took me to 
Similarity.java
- Ctrl-h

Two subclasses appeared: DefaultSimilarity, and 
TestSimilarity.SimpleSimilarity.

So there are two subclasses within Lucene's codebase, one used for 
testing.  To see it's usage, have a look at TestSimilarity.  The test 
cases are a great place to look for "documentation".

As for weighting - the scoring process uses weighting based on the type 
of query - look at the Query class and its subclasses to see those 
details.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message