You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Lance Norskog <go...@gmail.com> on 2010/06/22 07:29:51 UTC

Re: Mr Lance : customize the search algorithm of solr

Solr depends on Lucene's implementation of queries and how it returns
document hits. I can't help you architect these changes.

On Mon, Jun 21, 2010 at 7:47 AM, sarfaraz masood
<sa...@yahoo.com> wrote:
> Mr Lance
>
> Thanks
> a lot for ur reply.. I am a novice a solr / lucene. but i have gone
> thru the documentations of both.I have even implemented programs in
> lucene for searching etc.
>
> My problem is to apply a new search technique other than the one used by solr.
>
> Step 1: My algorithm finds the tf idf values of all  the terms in each url and makes a chart like this : -
>
>          term 1     term2      term3 ...........
> url 1    0.7         0.6          0.7
> url 2    0.0         0.5          0.4
> url 3
>  0.7         0.8          0.6
> ..
> .
> .
> .
> .
> (urls with 0 tf idf means word doesnt exist there.)
>
> This ways i first construct a complete chart  of term  tf idf to urls..
>
> Step 2 (Searcher )
> then
> depending on words in the query i select the correct urls by applying
> mathematical formulae. This result should be shown to the user in
> descending order.
>
> Now as i know that lucene has its own searcher
> which is used by solr as well. cant i replace this searcher part in
> SOLR by a java program that returns urls by my algorithm. Rest every
> thing should be of solr.
>
> Only change the searcher part. I have
> studied abt customizing the scoring which is absolutely not my aim.My
> aim seems to be replacing the searcher. It is a work similar to BM25
> work which u had mentioned in your reply  viz providing an alternate to
> lucene search.
>
> Plz help me in this regards. I will be highly gratefull to you for your assistance in this work of mine.
>
> If any part of this mail was not clear to you then plz lemme know, i will expain that you.
>
> Regards
>
> -sarfaraz
>
>



-- 
Lance Norskog
goksron@gmail.com

Re: Mr Lance : customize the search algorithm of solr

Posted by Chris Hostetter <ho...@fucit.org>.
: > depending on words in the query i select the correct urls by applying
: > mathematical formulae. This result should be shown to the user in
: > descending order.
: >
: > Now as i know that lucene has its own searcher
: > which is used by solr as well. cant i replace this searcher part in
: > SOLR by a java program that returns urls by my algorithm. Rest every
: > thing should be of solr.

Solr has no mechanism for replacing the Searcher -- Solr relies on using 
it's own SolrIndexSearcher which is how all of that "Rest every hing 
should be of solr" is possible.

: > Only change the searcher part. I have
: > studied abt customizing the scoring which is absolutely not my aim.My

You've described your goal as wanting to compute a numeric value you will 
sort on based on a mathematical result for each document/url based on the 
tf of the terms used -- that's pretty much the definition of scoring.

In simpel fact: changing the Searcher won't really help you, since the 
Searcher isn't what computes the score anyway -- that's done by the 
Scorer instances that the Queyr obejcts produce -- so you could write a 
custom QParser that generates Query objects with Scorer's that generate 
your mathematical formula, or you could use a custom ValueSource (generate 
by a custom ValueSourceParser using hte function query syntax) to do the 
same calculation.



-Hoss