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 "R. Tan" <ta...@gmail.com> on 2009/10/08 07:00:05 UTC

Scoring for specific field queries

Hi,
How can I get wildcard search (e.g. cha*) to score documents based on the
position of the keyword in a field? Closer (to the start) means higher
score.

For example, I have multiple documents with titles containing the word
"champion". Some of the document titles start with the word "champion" and
some our entitled "we are the champions". The ones that starts with the
keyword needs to rank first or score higher. Is there a way to do this? I'm
using this query for auto-suggest term feature where the keyword doesn't
necessarily need to be the first word.

Rihaed

Re: Scoring for specific field queries

Posted by "R. Tan" <ta...@gmail.com>.
I will try this out. How does 1 and 2 boost the my startswith query? Is it
because of the n-gram filter?


On Thu, Oct 8, 2009 at 1:29 PM, Avlesh Singh <av...@gmail.com> wrote:

> You would need to boost your "startswith" matches artificially for the
> desired behavior.
> I would do it this way -
>
>   1. Create a KeywordTokenized field with n-gram filter.
>   2. Create a Whitespace tokenized field with n-gram flter.
>   3. Search on both the fields, boost matches for #1 over #2.
>
> Hope this helps.
>
> Cheers
> Avlesh
>
> On Thu, Oct 8, 2009 at 10:30 AM, R. Tan <ta...@gmail.com> wrote:
>
> > Hi,
> > How can I get wildcard search (e.g. cha*) to score documents based on the
> > position of the keyword in a field? Closer (to the start) means higher
> > score.
> >
> > For example, I have multiple documents with titles containing the word
> > "champion". Some of the document titles start with the word "champion"
> and
> > some our entitled "we are the champions". The ones that starts with the
> > keyword needs to rank first or score higher. Is there a way to do this?
> I'm
> > using this query for auto-suggest term feature where the keyword doesn't
> > necessarily need to be the first word.
> >
> > Rihaed
> >
>

Re: Scoring for specific field queries

Posted by Avlesh Singh <av...@gmail.com>.
You would need to boost your "startswith" matches artificially for the
desired behavior.
I would do it this way -

   1. Create a KeywordTokenized field with n-gram filter.
   2. Create a Whitespace tokenized field with n-gram flter.
   3. Search on both the fields, boost matches for #1 over #2.

Hope this helps.

Cheers
Avlesh

On Thu, Oct 8, 2009 at 10:30 AM, R. Tan <ta...@gmail.com> wrote:

> Hi,
> How can I get wildcard search (e.g. cha*) to score documents based on the
> position of the keyword in a field? Closer (to the start) means higher
> score.
>
> For example, I have multiple documents with titles containing the word
> "champion". Some of the document titles start with the word "champion" and
> some our entitled "we are the champions". The ones that starts with the
> keyword needs to rank first or score higher. Is there a way to do this? I'm
> using this query for auto-suggest term feature where the keyword doesn't
> necessarily need to be the first word.
>
> Rihaed
>

Re: Scoring for specific field queries

Posted by "R. Tan" <ta...@gmail.com>.
Avlesh,

I got it, finally, by doing an OR between the two fields, one with an exact
match keyword and the other is grouped.

q=suggestion:"formula xxx" OR tokenized_suggestion:(formula xxxx)

Thanks for all your help!

Rih


On Fri, Oct 9, 2009 at 4:26 PM, R. Tan <ta...@gmail.com> wrote:

> I ended up with the same set of results earlier but I don't results such as
> "the champion", I think because of the EdgeNGram filter.
>
> With NGram, I'm back to the same problem:
>
> Result for q=ca
>
> <doc>
> <float name="score">0.8717008</float>
> <str name="tokenized_suggestion">Blu Jazz Cafe</str>
> </doc>
>
> <doc>
> <float name="score">0.8717008</float>
> <str name="tokenized_suggestion">Café in the Pond</str>
> </doc>
>
>

Re: Scoring for specific field queries

Posted by "R. Tan" <ta...@gmail.com>.
I ended up with the same set of results earlier but I don't results such as
"the champion", I think because of the EdgeNGram filter.

With NGram, I'm back to the same problem:

Result for q=ca

<doc>
<float name="score">0.8717008</float>
<str name="tokenized_suggestion">Blu Jazz Cafe</str>
</doc>

<doc>
<float name="score">0.8717008</float>
<str name="tokenized_suggestion">Café in the Pond</str>
</doc>


On Fri, Oct 9, 2009 at 4:02 PM, R. Tan <ta...@gmail.com> wrote:

> How do these filters help the autosuggest?
> <filter class="solr.PatternReplaceFilterFactory" pattern="^(.{20})(.*)?"
> replacement="$1" replace="all" />
> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>
>
>
> On Fri, Oct 9, 2009 at 3:59 PM, Avlesh Singh <av...@gmail.com> wrote:
>
>> >
>> > What are the replacements for, the special character and 20 char?
>> >
>> I had no time to diff between your definitions and mine. Copy-pasting mine
>> was easier :)
>>
>> Also, do you get results such as "XXXX formula"?
>> >
>> The "autocomplete" field would definitely not match this query, but the
>> "tokenized autocomplete" would.
>> Give it a shot, it should work as you expect it to.
>>
>> Cheers
>> Avlesh
>>
>> On Fri, Oct 9, 2009 at 1:25 PM, R. Tan <ta...@gmail.com> wrote:
>>
>> > Thanks, I'll give this a go. What are the replacements for, the special
>> > character and 20 char? Also, do you get results such as "XXXX formula"?
>> >
>> > On Fri, Oct 9, 2009 at 3:45 PM, Avlesh Singh <av...@gmail.com> wrote:
>> >
>> > > I have a very similar set-up for my auto-suggest (I am sorry that it
>> > can't
>> > > be viewed from an external network).
>> > > I am sending you my field definitions, please use them and see if it
>> > works
>> > > out correctly.
>> > >
>> > > <fieldType name="autocomplete" class="solr.TextField">
>> > >     <analyzer type="index">
>> > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
>> > >        <filter class="solr.LowerCaseFilterFactory" />
>> > >         <filter class="solr.PatternReplaceFilterFactory"
>> > > pattern="([^a-z0-9])" replacement="" replace="all" />
>> > >        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>> > >        <filter class="solr.EdgeNGramFilterFactory" maxGramSize="100"
>> > > minGramSize="1" />
>> > >     </analyzer>
>> > >    <analyzer type="query">
>> > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
>> > >        <filter class="solr.LowerCaseFilterFactory" />
>> > >         <filter class="solr.PatternReplaceFilterFactory"
>> > > pattern="([^a-z0-9])" replacement="" replace="all" />
>> > >        <filter class="solr.PatternReplaceFilterFactory"
>> > > pattern="^(.{20})(.*)?" replacement="$1" replace="all" />
>> > >        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>> > >    </analyzer>
>> > > </fieldType>
>> > >
>> > > <fieldType name="tokenized_autocomplete" class="solr.TextField">
>> > >     <analyzer type="index">
>> > >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>> > >        <filter class="solr.LowerCaseFilterFactory" />
>> > >         <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>> > >        <filter class="solr.EdgeNGramFilterFactory" maxGramSize="100"
>> > > minGramSize="1" />
>> > >     </analyzer>
>> > >    <analyzer type="query">
>> > >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>> > >        <filter class="solr.LowerCaseFilterFactory" />
>> > >         <filter class="solr.PatternReplaceFilterFactory"
>> > > pattern="([^a-z0-9])" replacement="" replace="all" />
>> > >        <filter class="solr.PatternReplaceFilterFactory"
>> > > pattern="^(.{20})(.*)?" replacement="$1" replace="all" />
>> > >        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>> > >    </analyzer>
>> > > </fieldType>
>> > >
>> > > <field name="suggestion" type="autocomplete" indexed="true"
>> > > stored="false"/>
>> > > <field name="tokenized_suggestion" type="tokenized_autocomplete"
>> > > indexed="true" stored="true"/>
>> > >
>> > > q=(suggestion:formula^2 tokenized_suggestion:formula)
>> > >
>> > > Hope this helps.
>> > >
>> > > Cheers
>> > > Avlesh
>> > >
>> > > On Fri, Oct 9, 2009 at 1:03 PM, R. Tan <ta...@gmail.com> wrote:
>> > >
>> > > > Yeah, I do get results. Anything else I missed out?
>> > > > I want it to work like this site's auto suggest feature.
>> > > >
>> > > > http://www.sematext.com/demo/ac/index.html
>> > > >
>> > > > Try the keyword 'formula'.
>> > > >
>> > > > Thanks,
>> > > > Rih
>> > > >
>> > > >
>> > > > On Fri, Oct 9, 2009 at 3:24 PM, Avlesh Singh <av...@gmail.com>
>> wrote:
>> > > >
>> > > > > Can you just do q=autoCompleteHelper2:caf to see you get results?
>> > > > >
>> > > > > Cheers
>> > > > > Avlesh
>> > > > >
>> > > > > On Fri, Oct 9, 2009 at 12:53 PM, R. Tan <ta...@gmail.com>
>> > wrote:
>> > > > >
>> > > > > > Yup, it is. Both are copied from another field called name.
>> > > > > >
>> > > > > > On Fri, Oct 9, 2009 at 3:15 PM, Avlesh Singh <av...@gmail.com>
>> > > wrote:
>> > > > > >
>> > > > > > > Lame question, but are you populating data in the
>> > > autoCompleteHelper2
>> > > > > > > field?
>> > > > > > >
>> > > > > > > Cheers
>> > > > > > > Avlesh
>> > > > > > >
>> > > > > > > On Fri, Oct 9, 2009 at 12:36 PM, R. Tan <
>> tanrihaed58@gmail.com>
>> > > > wrote:
>> > > > > > >
>> > > > > > > > The problem is, I'm getting equal scores for this:
>> > > > > > > > Query:
>> > > > > > > > q=(autoCompleteHelper2:caf^10.0 autoCompleteHelper:caf)
>> > > > > > > >
>> > > > > > > > Partial Result:
>> > > > > > > >
>> > > > > > > > <doc>
>> > > > > > > > <float name="score">0.7821733</float>
>> > > > > > > > <str name="autoCompleteHelper">Bikes Café</str>
>> > > > > > > > </doc>
>> > > > > > > >
>> > > > > > > > <doc>
>> > > > > > > > <float name="score">0.7821733</float>
>> > > > > > > > <str name="autoCompleteHelper">Cafe Feliy</str>
>> > > > > > > > </doc>
>> > > > > > > >
>> > > > > > > > I'm using the standard request handler with this.
>> > > > > > > >
>> > > > > > > > Thanks,
>> > > > > > > > Rih
>> > > > > > > >
>> > > > > > > >
>> > > > > > > > On Fri, Oct 9, 2009 at 3:02 PM, R. Tan <
>> tanrihaed58@gmail.com>
>> > > > > wrote:
>> > > > > > > >
>> > > > > > > > > Avlesh,
>> > > > > > > > > I don't see anything wrong with the data from analysis.
>> > > > > > > > >
>> > > > > > > > > KeywordTokenized:
>> > > > > > > > >
>> > > > > > > > > *term position ** **1** **2** **3** **4** **5** **6**
>> **7**
>> > > **8**
>> > > > > > **9**
>> > > > > > > > **
>> > > > > > > > > 10** **11** **12** **13** **14** **15** **16** **...*
>> > > > > > > > > *term text ** **th** **he** **e ** **c** **ch** **ha**
>> **am**
>> > > > > **mp**
>> > > > > > > > **pi*
>> > > > > > > > > * **io** **on** **the** **he ** **e c** **ch** **cha**
>> **...*
>> > > > > > > > > *term type ** **word** **word** **word** **word** **word**
>> > > > **word**
>> > > > > > > > **word
>> > > > > > > > > ** **word** **word** **word** **word** **word** **word**
>> > > **word**
>> > > > > > > > **word**
>> > > > > > > > > **word** **...*
>> > > > > > > > > *source start,end ** **0,2** **1,3** **2,4** **3,5**
>> **4,6**
>> > > > > **5,7**
>> > > > > > > > **6,8
>> > > > > > > > > ** **7,9** **8,10** **9,11** **10,12** **0,3** **1,4**
>> > **2,5**
>> > > > > > **3,6**
>> > > > > > > **
>> > > > > > > > > ...*
>> > > > > > > > >
>> > > > > > > > > WhitespaceTokenized:
>> > > > > > > > >
>> > > > > > > > > *term position ** **1** **2** **3** **4** **5** **6**
>> **7**
>> > > **8**
>> > > > > > **9**
>> > > > > > > > **
>> > > > > > > > > 10** **11** **...*
>> > > > > > > > > *term text ** **th** **he** **the** **ch** **ha** **am**
>> > **mp**
>> > > > > > **pi**
>> > > > > > > **
>> > > > > > > > > io** **on** **cha** **...*
>> > > > > > > > > *term type ** **word** **word** **word** **word** **word**
>> > > > **word**
>> > > > > > > > **word
>> > > > > > > > > ** **word** **word** **word** **word** **...*
>> > > > > > > > > *source start,end ** **0,2** **1,3** **0,3** **0,2**
>> **1,3**
>> > > > > **2,4**
>> > > > > > > > **3,5
>> > > > > > > > > ** **4,6** **5,7** **6,8** **...*
>> > > > > > > > >
>> > > > > > > > > Is term position considered during scoring?
>> > > > > > > > >
>> > > > > > > > > Thanks,
>> > > > > > > > > Rih
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > > > On Fri, Oct 9, 2009 at 9:40 AM, Avlesh Singh <
>> > avlesh@gmail.com
>> > > >
>> > > > > > wrote:
>> > > > > > > > >
>> > > > > > > > >> Use the field analysis tool to see how the data is being
>> > > > analyzed
>> > > > > in
>> > > > > > > > both
>> > > > > > > > >> the fields.
>> > > > > > > > >>
>> > > > > > > > >> Cheers
>> > > > > > > > >> Avlesh
>> > > > > > > > >>
>> > > > > > > > >> On Fri, Oct 9, 2009 at 12:56 AM, R. Tan <
>> > > tanrihaed58@gmail.com>
>> > > > > > > wrote:
>> > > > > > > > >>
>> > > > > > > > >> > Hmm... I don't quite get the desired results. Those
>> > starting
>> > > > > with
>> > > > > > > > "cha"
>> > > > > > > > >> are
>> > > > > > > > >> > now randomly ordered. Is there something wrong with the
>> > > > filters
>> > > > > I
>> > > > > > > > >> applied?
>> > > > > > > > >> >
>> > > > > > > > >> >
>> > > > > > > > >> > On Thu, Oct 8, 2009 at 7:38 PM, Avlesh Singh <
>> > > > avlesh@gmail.com>
>> > > > > > > > wrote:
>> > > > > > > > >> >
>> > > > > > > > >> > > Filters? I did not mean filters at all.
>> > > > > > > > >> > > I am in a mad rush right now, but on the face of it
>> your
>> > > > field
>> > > > > > > > >> > definitions
>> > > > > > > > >> > > look right.
>> > > > > > > > >> > >
>> > > > > > > > >> > > This is what I asked for -
>> > > > > > > > >> > > q=(autoComplete2:cha^10 autoComplete:cha)
>> > > > > > > > >> > >
>> > > > > > > > >> > > Lemme know if this does not work for you.
>> > > > > > > > >> > >
>> > > > > > > > >> > > Cheers
>> > > > > > > > >> > > Avlesh
>> > > > > > > > >> > >
>> > > > > > > > >> > > On Thu, Oct 8, 2009 at 4:58 PM, R. Tan <
>> > > > tanrihaed58@gmail.com
>> > > > > >
>> > > > > > > > wrote:
>> > > > > > > > >> > >
>> > > > > > > > >> > > > Hi Avlesh,
>> > > > > > > > >> > > >
>> > > > > > > > >> > > > I can't seem to get the scores right.
>> > > > > > > > >> > > >
>> > > > > > > > >> > > > I now have these types for the fields I'm
>> targeting,
>> > > > > > > > >> > > >
>> > > > > > > > >> > > > <fieldType name="autoComplete"
>> class="solr.TextField"
>> > > > > > > > >> > > > positionIncrementGap="1">
>> > > > > > > > >> > > >      <analyzer type="index">
>> > > > > > > > >> > > >        <tokenizer
>> > > > class="solr.WhitespaceTokenizerFactory"/>
>> > > > > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory"
>> />
>> > > > > > > > >> > > >        <filter class="solr.NGramFilterFactory"
>> > > > > minGramSize="1"
>> > > > > > > > >> > > > maxGramSize="20"/>
>> > > > > > > > >> > > >      </analyzer>
>> > > > > > > > >> > > >      <analyzer type="query">
>> > > > > > > > >> > > >        <tokenizer
>> > > > class="solr.WhitespaceTokenizerFactory"/>
>> > > > > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory"
>> />
>> > > > > > > > >> > > >      </analyzer>
>> > > > > > > > >> > > >    </fieldType>
>> > > > > > > > >> > > >    <fieldType name="autoComplete2"
>> > > class="solr.TextField"
>> > > > > > > > >> > > > positionIncrementGap="1">
>> > > > > > > > >> > > >      <analyzer type="index">
>> > > > > > > > >> > > >        <tokenizer
>> > class="solr.KeywordTokenizerFactory"/>
>> > > > > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory"
>> />
>> > > > > > > > >> > > >        <filter class="solr.NGramFilterFactory"
>> > > > > minGramSize="1"
>> > > > > > > > >> > > > maxGramSize="20"/>
>> > > > > > > > >> > > >      </analyzer>
>> > > > > > > > >> > > >      <analyzer type="query">
>> > > > > > > > >> > > >        <tokenizer
>> > class="solr.KeywordTokenizerFactory"/>
>> > > > > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory"
>> />
>> > > > > > > > >> > > >      </analyzer>
>> > > > > > > > >> > > >    </fieldType>
>> > > > > > > > >> > > >
>> > > > > > > > >> > > > My query is this,
>> > > > > > > > >> > > >
>> > > > > > > > >> > > >
>> > > > > > > > >> > >
>> > > > > > > > >> >
>> > > > > > > > >>
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> q=*:*&fq=autoCompleteHelper:cha+autoCompleteHelper2:cha&qf=autoCompleteHelper^10.0+autoCompleteHelper2^1.0
>> > > > > > > > >> > > >
>> > > > > > > > >> > > > What should I tweak from the above config and
>> query?
>> > > > > > > > >> > > >
>> > > > > > > > >> > > > Thanks,
>> > > > > > > > >> > > > Rih
>> > > > > > > > >> > > >
>> > > > > > > > >> > > >
>> > > > > > > > >> > > > On Thu, Oct 8, 2009 at 4:38 PM, R. Tan <
>> > > > > tanrihaed58@gmail.com
>> > > > > > >
>> > > > > > > > >> wrote:
>> > > > > > > > >> > > >
>> > > > > > > > >> > > > > I will have to pass on this and try your
>> suggestion
>> > > > first.
>> > > > > > So,
>> > > > > > > > how
>> > > > > > > > >> > does
>> > > > > > > > >> > > > > your suggestion (1 and 2) boost the my startswith
>> > > query?
>> > > > > Is
>> > > > > > it
>> > > > > > > > >> > because
>> > > > > > > > >> > > of
>> > > > > > > > >> > > > > the n-gram filter?
>> > > > > > > > >> > > > >
>> > > > > > > > >> > > > >
>> > > > > > > > >> > > > >
>> > > > > > > > >> > > > > On Thu, Oct 8, 2009 at 2:27 PM, Sandeep Tagore <
>> > > > > > > > >> > > sandeep.tagore@gmail.com
>> > > > > > > > >> > > > >wrote:
>> > > > > > > > >> > > > >
>> > > > > > > > >> > > > >>
>> > > > > > > > >> > > > >> Yes it can be done but it needs some
>> customization.
>> > > > > Search
>> > > > > > > for
>> > > > > > > > >> > custom
>> > > > > > > > >> > > > sort
>> > > > > > > > >> > > > >> implementations/discussions.
>> > > > > > > > >> > > > >> You can check...
>> > > > > > > > >> > > > >>
>> > > > > > > > >> > > > >>
>> > > > > > > > >> > > >
>> > > > > > > > >> > >
>> > > > > > > > >> >
>> > > > > > > > >>
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html
>> > > > > > > > >> > > > >> .
>> > > > > > > > >> > > > >> Let us know if you have any issues.
>> > > > > > > > >> > > > >>
>> > > > > > > > >> > > > >> Sandeep
>> > > > > > > > >> > > > >>
>> > > > > > > > >> > > > >>
>> > > > > > > > >> > > > >> R. Tan wrote:
>> > > > > > > > >> > > > >> >
>> > > > > > > > >> > > > >> > This might work and I also have a single value
>> > > field
>> > > > > > which
>> > > > > > > > >> makes
>> > > > > > > > >> > it
>> > > > > > > > >> > > > >> > cleaner.
>> > > > > > > > >> > > > >> > Can sort be customized (with indexOf()) from
>> the
>> > > solr
>> > > > > > > > >> parameters
>> > > > > > > > >> > > > alone?
>> > > > > > > > >> > > > >> >
>> > > > > > > > >> > > > >>
>> > > > > > > > >> > > > >> --
>> > > > > > > > >> > > > >> View this message in context:
>> > > > > > > > >> > > > >>
>> > > > > > > > >> > > >
>> > > > > > > > >> > >
>> > > > > > > > >> >
>> > > > > > > > >>
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25799055.html
>> > > > > > > > >> > > > >> Sent from the Solr - User mailing list archive
>> at
>> > > > > > Nabble.com.
>> > > > > > > > >> > > > >>
>> > > > > > > > >> > > > >>
>> > > > > > > > >> > > > >
>> > > > > > > > >> > > >
>> > > > > > > > >> > >
>> > > > > > > > >> >
>> > > > > > > > >>
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>>
>
>

Re: Scoring for specific field queries

Posted by "R. Tan" <ta...@gmail.com>.
How do these filters help the autosuggest?
<filter class="solr.PatternReplaceFilterFactory" pattern="^(.{20})(.*)?"
replacement="$1" replace="all" />
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>



On Fri, Oct 9, 2009 at 3:59 PM, Avlesh Singh <av...@gmail.com> wrote:

> >
> > What are the replacements for, the special character and 20 char?
> >
> I had no time to diff between your definitions and mine. Copy-pasting mine
> was easier :)
>
> Also, do you get results such as "XXXX formula"?
> >
> The "autocomplete" field would definitely not match this query, but the
> "tokenized autocomplete" would.
> Give it a shot, it should work as you expect it to.
>
> Cheers
> Avlesh
>
> On Fri, Oct 9, 2009 at 1:25 PM, R. Tan <ta...@gmail.com> wrote:
>
> > Thanks, I'll give this a go. What are the replacements for, the special
> > character and 20 char? Also, do you get results such as "XXXX formula"?
> >
> > On Fri, Oct 9, 2009 at 3:45 PM, Avlesh Singh <av...@gmail.com> wrote:
> >
> > > I have a very similar set-up for my auto-suggest (I am sorry that it
> > can't
> > > be viewed from an external network).
> > > I am sending you my field definitions, please use them and see if it
> > works
> > > out correctly.
> > >
> > > <fieldType name="autocomplete" class="solr.TextField">
> > >     <analyzer type="index">
> > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> > >        <filter class="solr.LowerCaseFilterFactory" />
> > >         <filter class="solr.PatternReplaceFilterFactory"
> > > pattern="([^a-z0-9])" replacement="" replace="all" />
> > >        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
> > >        <filter class="solr.EdgeNGramFilterFactory" maxGramSize="100"
> > > minGramSize="1" />
> > >     </analyzer>
> > >    <analyzer type="query">
> > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> > >        <filter class="solr.LowerCaseFilterFactory" />
> > >         <filter class="solr.PatternReplaceFilterFactory"
> > > pattern="([^a-z0-9])" replacement="" replace="all" />
> > >        <filter class="solr.PatternReplaceFilterFactory"
> > > pattern="^(.{20})(.*)?" replacement="$1" replace="all" />
> > >        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
> > >    </analyzer>
> > > </fieldType>
> > >
> > > <fieldType name="tokenized_autocomplete" class="solr.TextField">
> > >     <analyzer type="index">
> > >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> > >        <filter class="solr.LowerCaseFilterFactory" />
> > >         <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
> > >        <filter class="solr.EdgeNGramFilterFactory" maxGramSize="100"
> > > minGramSize="1" />
> > >     </analyzer>
> > >    <analyzer type="query">
> > >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> > >        <filter class="solr.LowerCaseFilterFactory" />
> > >         <filter class="solr.PatternReplaceFilterFactory"
> > > pattern="([^a-z0-9])" replacement="" replace="all" />
> > >        <filter class="solr.PatternReplaceFilterFactory"
> > > pattern="^(.{20})(.*)?" replacement="$1" replace="all" />
> > >        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
> > >    </analyzer>
> > > </fieldType>
> > >
> > > <field name="suggestion" type="autocomplete" indexed="true"
> > > stored="false"/>
> > > <field name="tokenized_suggestion" type="tokenized_autocomplete"
> > > indexed="true" stored="true"/>
> > >
> > > q=(suggestion:formula^2 tokenized_suggestion:formula)
> > >
> > > Hope this helps.
> > >
> > > Cheers
> > > Avlesh
> > >
> > > On Fri, Oct 9, 2009 at 1:03 PM, R. Tan <ta...@gmail.com> wrote:
> > >
> > > > Yeah, I do get results. Anything else I missed out?
> > > > I want it to work like this site's auto suggest feature.
> > > >
> > > > http://www.sematext.com/demo/ac/index.html
> > > >
> > > > Try the keyword 'formula'.
> > > >
> > > > Thanks,
> > > > Rih
> > > >
> > > >
> > > > On Fri, Oct 9, 2009 at 3:24 PM, Avlesh Singh <av...@gmail.com>
> wrote:
> > > >
> > > > > Can you just do q=autoCompleteHelper2:caf to see you get results?
> > > > >
> > > > > Cheers
> > > > > Avlesh
> > > > >
> > > > > On Fri, Oct 9, 2009 at 12:53 PM, R. Tan <ta...@gmail.com>
> > wrote:
> > > > >
> > > > > > Yup, it is. Both are copied from another field called name.
> > > > > >
> > > > > > On Fri, Oct 9, 2009 at 3:15 PM, Avlesh Singh <av...@gmail.com>
> > > wrote:
> > > > > >
> > > > > > > Lame question, but are you populating data in the
> > > autoCompleteHelper2
> > > > > > > field?
> > > > > > >
> > > > > > > Cheers
> > > > > > > Avlesh
> > > > > > >
> > > > > > > On Fri, Oct 9, 2009 at 12:36 PM, R. Tan <tanrihaed58@gmail.com
> >
> > > > wrote:
> > > > > > >
> > > > > > > > The problem is, I'm getting equal scores for this:
> > > > > > > > Query:
> > > > > > > > q=(autoCompleteHelper2:caf^10.0 autoCompleteHelper:caf)
> > > > > > > >
> > > > > > > > Partial Result:
> > > > > > > >
> > > > > > > > <doc>
> > > > > > > > <float name="score">0.7821733</float>
> > > > > > > > <str name="autoCompleteHelper">Bikes Café</str>
> > > > > > > > </doc>
> > > > > > > >
> > > > > > > > <doc>
> > > > > > > > <float name="score">0.7821733</float>
> > > > > > > > <str name="autoCompleteHelper">Cafe Feliy</str>
> > > > > > > > </doc>
> > > > > > > >
> > > > > > > > I'm using the standard request handler with this.
> > > > > > > >
> > > > > > > > Thanks,
> > > > > > > > Rih
> > > > > > > >
> > > > > > > >
> > > > > > > > On Fri, Oct 9, 2009 at 3:02 PM, R. Tan <
> tanrihaed58@gmail.com>
> > > > > wrote:
> > > > > > > >
> > > > > > > > > Avlesh,
> > > > > > > > > I don't see anything wrong with the data from analysis.
> > > > > > > > >
> > > > > > > > > KeywordTokenized:
> > > > > > > > >
> > > > > > > > > *term position ** **1** **2** **3** **4** **5** **6** **7**
> > > **8**
> > > > > > **9**
> > > > > > > > **
> > > > > > > > > 10** **11** **12** **13** **14** **15** **16** **...*
> > > > > > > > > *term text ** **th** **he** **e ** **c** **ch** **ha**
> **am**
> > > > > **mp**
> > > > > > > > **pi*
> > > > > > > > > * **io** **on** **the** **he ** **e c** **ch** **cha**
> **...*
> > > > > > > > > *term type ** **word** **word** **word** **word** **word**
> > > > **word**
> > > > > > > > **word
> > > > > > > > > ** **word** **word** **word** **word** **word** **word**
> > > **word**
> > > > > > > > **word**
> > > > > > > > > **word** **...*
> > > > > > > > > *source start,end ** **0,2** **1,3** **2,4** **3,5**
> **4,6**
> > > > > **5,7**
> > > > > > > > **6,8
> > > > > > > > > ** **7,9** **8,10** **9,11** **10,12** **0,3** **1,4**
> > **2,5**
> > > > > > **3,6**
> > > > > > > **
> > > > > > > > > ...*
> > > > > > > > >
> > > > > > > > > WhitespaceTokenized:
> > > > > > > > >
> > > > > > > > > *term position ** **1** **2** **3** **4** **5** **6** **7**
> > > **8**
> > > > > > **9**
> > > > > > > > **
> > > > > > > > > 10** **11** **...*
> > > > > > > > > *term text ** **th** **he** **the** **ch** **ha** **am**
> > **mp**
> > > > > > **pi**
> > > > > > > **
> > > > > > > > > io** **on** **cha** **...*
> > > > > > > > > *term type ** **word** **word** **word** **word** **word**
> > > > **word**
> > > > > > > > **word
> > > > > > > > > ** **word** **word** **word** **word** **...*
> > > > > > > > > *source start,end ** **0,2** **1,3** **0,3** **0,2**
> **1,3**
> > > > > **2,4**
> > > > > > > > **3,5
> > > > > > > > > ** **4,6** **5,7** **6,8** **...*
> > > > > > > > >
> > > > > > > > > Is term position considered during scoring?
> > > > > > > > >
> > > > > > > > > Thanks,
> > > > > > > > > Rih
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > On Fri, Oct 9, 2009 at 9:40 AM, Avlesh Singh <
> > avlesh@gmail.com
> > > >
> > > > > > wrote:
> > > > > > > > >
> > > > > > > > >> Use the field analysis tool to see how the data is being
> > > > analyzed
> > > > > in
> > > > > > > > both
> > > > > > > > >> the fields.
> > > > > > > > >>
> > > > > > > > >> Cheers
> > > > > > > > >> Avlesh
> > > > > > > > >>
> > > > > > > > >> On Fri, Oct 9, 2009 at 12:56 AM, R. Tan <
> > > tanrihaed58@gmail.com>
> > > > > > > wrote:
> > > > > > > > >>
> > > > > > > > >> > Hmm... I don't quite get the desired results. Those
> > starting
> > > > > with
> > > > > > > > "cha"
> > > > > > > > >> are
> > > > > > > > >> > now randomly ordered. Is there something wrong with the
> > > > filters
> > > > > I
> > > > > > > > >> applied?
> > > > > > > > >> >
> > > > > > > > >> >
> > > > > > > > >> > On Thu, Oct 8, 2009 at 7:38 PM, Avlesh Singh <
> > > > avlesh@gmail.com>
> > > > > > > > wrote:
> > > > > > > > >> >
> > > > > > > > >> > > Filters? I did not mean filters at all.
> > > > > > > > >> > > I am in a mad rush right now, but on the face of it
> your
> > > > field
> > > > > > > > >> > definitions
> > > > > > > > >> > > look right.
> > > > > > > > >> > >
> > > > > > > > >> > > This is what I asked for -
> > > > > > > > >> > > q=(autoComplete2:cha^10 autoComplete:cha)
> > > > > > > > >> > >
> > > > > > > > >> > > Lemme know if this does not work for you.
> > > > > > > > >> > >
> > > > > > > > >> > > Cheers
> > > > > > > > >> > > Avlesh
> > > > > > > > >> > >
> > > > > > > > >> > > On Thu, Oct 8, 2009 at 4:58 PM, R. Tan <
> > > > tanrihaed58@gmail.com
> > > > > >
> > > > > > > > wrote:
> > > > > > > > >> > >
> > > > > > > > >> > > > Hi Avlesh,
> > > > > > > > >> > > >
> > > > > > > > >> > > > I can't seem to get the scores right.
> > > > > > > > >> > > >
> > > > > > > > >> > > > I now have these types for the fields I'm targeting,
> > > > > > > > >> > > >
> > > > > > > > >> > > > <fieldType name="autoComplete"
> class="solr.TextField"
> > > > > > > > >> > > > positionIncrementGap="1">
> > > > > > > > >> > > >      <analyzer type="index">
> > > > > > > > >> > > >        <tokenizer
> > > > class="solr.WhitespaceTokenizerFactory"/>
> > > > > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory"
> />
> > > > > > > > >> > > >        <filter class="solr.NGramFilterFactory"
> > > > > minGramSize="1"
> > > > > > > > >> > > > maxGramSize="20"/>
> > > > > > > > >> > > >      </analyzer>
> > > > > > > > >> > > >      <analyzer type="query">
> > > > > > > > >> > > >        <tokenizer
> > > > class="solr.WhitespaceTokenizerFactory"/>
> > > > > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory"
> />
> > > > > > > > >> > > >      </analyzer>
> > > > > > > > >> > > >    </fieldType>
> > > > > > > > >> > > >    <fieldType name="autoComplete2"
> > > class="solr.TextField"
> > > > > > > > >> > > > positionIncrementGap="1">
> > > > > > > > >> > > >      <analyzer type="index">
> > > > > > > > >> > > >        <tokenizer
> > class="solr.KeywordTokenizerFactory"/>
> > > > > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory"
> />
> > > > > > > > >> > > >        <filter class="solr.NGramFilterFactory"
> > > > > minGramSize="1"
> > > > > > > > >> > > > maxGramSize="20"/>
> > > > > > > > >> > > >      </analyzer>
> > > > > > > > >> > > >      <analyzer type="query">
> > > > > > > > >> > > >        <tokenizer
> > class="solr.KeywordTokenizerFactory"/>
> > > > > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory"
> />
> > > > > > > > >> > > >      </analyzer>
> > > > > > > > >> > > >    </fieldType>
> > > > > > > > >> > > >
> > > > > > > > >> > > > My query is this,
> > > > > > > > >> > > >
> > > > > > > > >> > > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> q=*:*&fq=autoCompleteHelper:cha+autoCompleteHelper2:cha&qf=autoCompleteHelper^10.0+autoCompleteHelper2^1.0
> > > > > > > > >> > > >
> > > > > > > > >> > > > What should I tweak from the above config and query?
> > > > > > > > >> > > >
> > > > > > > > >> > > > Thanks,
> > > > > > > > >> > > > Rih
> > > > > > > > >> > > >
> > > > > > > > >> > > >
> > > > > > > > >> > > > On Thu, Oct 8, 2009 at 4:38 PM, R. Tan <
> > > > > tanrihaed58@gmail.com
> > > > > > >
> > > > > > > > >> wrote:
> > > > > > > > >> > > >
> > > > > > > > >> > > > > I will have to pass on this and try your
> suggestion
> > > > first.
> > > > > > So,
> > > > > > > > how
> > > > > > > > >> > does
> > > > > > > > >> > > > > your suggestion (1 and 2) boost the my startswith
> > > query?
> > > > > Is
> > > > > > it
> > > > > > > > >> > because
> > > > > > > > >> > > of
> > > > > > > > >> > > > > the n-gram filter?
> > > > > > > > >> > > > >
> > > > > > > > >> > > > >
> > > > > > > > >> > > > >
> > > > > > > > >> > > > > On Thu, Oct 8, 2009 at 2:27 PM, Sandeep Tagore <
> > > > > > > > >> > > sandeep.tagore@gmail.com
> > > > > > > > >> > > > >wrote:
> > > > > > > > >> > > > >
> > > > > > > > >> > > > >>
> > > > > > > > >> > > > >> Yes it can be done but it needs some
> customization.
> > > > > Search
> > > > > > > for
> > > > > > > > >> > custom
> > > > > > > > >> > > > sort
> > > > > > > > >> > > > >> implementations/discussions.
> > > > > > > > >> > > > >> You can check...
> > > > > > > > >> > > > >>
> > > > > > > > >> > > > >>
> > > > > > > > >> > > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html
> > > > > > > > >> > > > >> .
> > > > > > > > >> > > > >> Let us know if you have any issues.
> > > > > > > > >> > > > >>
> > > > > > > > >> > > > >> Sandeep
> > > > > > > > >> > > > >>
> > > > > > > > >> > > > >>
> > > > > > > > >> > > > >> R. Tan wrote:
> > > > > > > > >> > > > >> >
> > > > > > > > >> > > > >> > This might work and I also have a single value
> > > field
> > > > > > which
> > > > > > > > >> makes
> > > > > > > > >> > it
> > > > > > > > >> > > > >> > cleaner.
> > > > > > > > >> > > > >> > Can sort be customized (with indexOf()) from
> the
> > > solr
> > > > > > > > >> parameters
> > > > > > > > >> > > > alone?
> > > > > > > > >> > > > >> >
> > > > > > > > >> > > > >>
> > > > > > > > >> > > > >> --
> > > > > > > > >> > > > >> View this message in context:
> > > > > > > > >> > > > >>
> > > > > > > > >> > > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25799055.html
> > > > > > > > >> > > > >> Sent from the Solr - User mailing list archive at
> > > > > > Nabble.com.
> > > > > > > > >> > > > >>
> > > > > > > > >> > > > >>
> > > > > > > > >> > > > >
> > > > > > > > >> > > >
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: Scoring for specific field queries

Posted by Avlesh Singh <av...@gmail.com>.
>
> What are the replacements for, the special character and 20 char?
>
I had no time to diff between your definitions and mine. Copy-pasting mine
was easier :)

Also, do you get results such as "XXXX formula"?
>
The "autocomplete" field would definitely not match this query, but the
"tokenized autocomplete" would.
Give it a shot, it should work as you expect it to.

Cheers
Avlesh

On Fri, Oct 9, 2009 at 1:25 PM, R. Tan <ta...@gmail.com> wrote:

> Thanks, I'll give this a go. What are the replacements for, the special
> character and 20 char? Also, do you get results such as "XXXX formula"?
>
> On Fri, Oct 9, 2009 at 3:45 PM, Avlesh Singh <av...@gmail.com> wrote:
>
> > I have a very similar set-up for my auto-suggest (I am sorry that it
> can't
> > be viewed from an external network).
> > I am sending you my field definitions, please use them and see if it
> works
> > out correctly.
> >
> > <fieldType name="autocomplete" class="solr.TextField">
> >     <analyzer type="index">
> >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> >        <filter class="solr.LowerCaseFilterFactory" />
> >         <filter class="solr.PatternReplaceFilterFactory"
> > pattern="([^a-z0-9])" replacement="" replace="all" />
> >        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
> >        <filter class="solr.EdgeNGramFilterFactory" maxGramSize="100"
> > minGramSize="1" />
> >     </analyzer>
> >    <analyzer type="query">
> >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> >        <filter class="solr.LowerCaseFilterFactory" />
> >         <filter class="solr.PatternReplaceFilterFactory"
> > pattern="([^a-z0-9])" replacement="" replace="all" />
> >        <filter class="solr.PatternReplaceFilterFactory"
> > pattern="^(.{20})(.*)?" replacement="$1" replace="all" />
> >        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
> >    </analyzer>
> > </fieldType>
> >
> > <fieldType name="tokenized_autocomplete" class="solr.TextField">
> >     <analyzer type="index">
> >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> >        <filter class="solr.LowerCaseFilterFactory" />
> >         <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
> >        <filter class="solr.EdgeNGramFilterFactory" maxGramSize="100"
> > minGramSize="1" />
> >     </analyzer>
> >    <analyzer type="query">
> >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> >        <filter class="solr.LowerCaseFilterFactory" />
> >         <filter class="solr.PatternReplaceFilterFactory"
> > pattern="([^a-z0-9])" replacement="" replace="all" />
> >        <filter class="solr.PatternReplaceFilterFactory"
> > pattern="^(.{20})(.*)?" replacement="$1" replace="all" />
> >        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
> >    </analyzer>
> > </fieldType>
> >
> > <field name="suggestion" type="autocomplete" indexed="true"
> > stored="false"/>
> > <field name="tokenized_suggestion" type="tokenized_autocomplete"
> > indexed="true" stored="true"/>
> >
> > q=(suggestion:formula^2 tokenized_suggestion:formula)
> >
> > Hope this helps.
> >
> > Cheers
> > Avlesh
> >
> > On Fri, Oct 9, 2009 at 1:03 PM, R. Tan <ta...@gmail.com> wrote:
> >
> > > Yeah, I do get results. Anything else I missed out?
> > > I want it to work like this site's auto suggest feature.
> > >
> > > http://www.sematext.com/demo/ac/index.html
> > >
> > > Try the keyword 'formula'.
> > >
> > > Thanks,
> > > Rih
> > >
> > >
> > > On Fri, Oct 9, 2009 at 3:24 PM, Avlesh Singh <av...@gmail.com> wrote:
> > >
> > > > Can you just do q=autoCompleteHelper2:caf to see you get results?
> > > >
> > > > Cheers
> > > > Avlesh
> > > >
> > > > On Fri, Oct 9, 2009 at 12:53 PM, R. Tan <ta...@gmail.com>
> wrote:
> > > >
> > > > > Yup, it is. Both are copied from another field called name.
> > > > >
> > > > > On Fri, Oct 9, 2009 at 3:15 PM, Avlesh Singh <av...@gmail.com>
> > wrote:
> > > > >
> > > > > > Lame question, but are you populating data in the
> > autoCompleteHelper2
> > > > > > field?
> > > > > >
> > > > > > Cheers
> > > > > > Avlesh
> > > > > >
> > > > > > On Fri, Oct 9, 2009 at 12:36 PM, R. Tan <ta...@gmail.com>
> > > wrote:
> > > > > >
> > > > > > > The problem is, I'm getting equal scores for this:
> > > > > > > Query:
> > > > > > > q=(autoCompleteHelper2:caf^10.0 autoCompleteHelper:caf)
> > > > > > >
> > > > > > > Partial Result:
> > > > > > >
> > > > > > > <doc>
> > > > > > > <float name="score">0.7821733</float>
> > > > > > > <str name="autoCompleteHelper">Bikes Café</str>
> > > > > > > </doc>
> > > > > > >
> > > > > > > <doc>
> > > > > > > <float name="score">0.7821733</float>
> > > > > > > <str name="autoCompleteHelper">Cafe Feliy</str>
> > > > > > > </doc>
> > > > > > >
> > > > > > > I'm using the standard request handler with this.
> > > > > > >
> > > > > > > Thanks,
> > > > > > > Rih
> > > > > > >
> > > > > > >
> > > > > > > On Fri, Oct 9, 2009 at 3:02 PM, R. Tan <ta...@gmail.com>
> > > > wrote:
> > > > > > >
> > > > > > > > Avlesh,
> > > > > > > > I don't see anything wrong with the data from analysis.
> > > > > > > >
> > > > > > > > KeywordTokenized:
> > > > > > > >
> > > > > > > > *term position ** **1** **2** **3** **4** **5** **6** **7**
> > **8**
> > > > > **9**
> > > > > > > **
> > > > > > > > 10** **11** **12** **13** **14** **15** **16** **...*
> > > > > > > > *term text ** **th** **he** **e ** **c** **ch** **ha** **am**
> > > > **mp**
> > > > > > > **pi*
> > > > > > > > * **io** **on** **the** **he ** **e c** **ch** **cha** **...*
> > > > > > > > *term type ** **word** **word** **word** **word** **word**
> > > **word**
> > > > > > > **word
> > > > > > > > ** **word** **word** **word** **word** **word** **word**
> > **word**
> > > > > > > **word**
> > > > > > > > **word** **...*
> > > > > > > > *source start,end ** **0,2** **1,3** **2,4** **3,5** **4,6**
> > > > **5,7**
> > > > > > > **6,8
> > > > > > > > ** **7,9** **8,10** **9,11** **10,12** **0,3** **1,4**
> **2,5**
> > > > > **3,6**
> > > > > > **
> > > > > > > > ...*
> > > > > > > >
> > > > > > > > WhitespaceTokenized:
> > > > > > > >
> > > > > > > > *term position ** **1** **2** **3** **4** **5** **6** **7**
> > **8**
> > > > > **9**
> > > > > > > **
> > > > > > > > 10** **11** **...*
> > > > > > > > *term text ** **th** **he** **the** **ch** **ha** **am**
> **mp**
> > > > > **pi**
> > > > > > **
> > > > > > > > io** **on** **cha** **...*
> > > > > > > > *term type ** **word** **word** **word** **word** **word**
> > > **word**
> > > > > > > **word
> > > > > > > > ** **word** **word** **word** **word** **...*
> > > > > > > > *source start,end ** **0,2** **1,3** **0,3** **0,2** **1,3**
> > > > **2,4**
> > > > > > > **3,5
> > > > > > > > ** **4,6** **5,7** **6,8** **...*
> > > > > > > >
> > > > > > > > Is term position considered during scoring?
> > > > > > > >
> > > > > > > > Thanks,
> > > > > > > > Rih
> > > > > > > >
> > > > > > > >
> > > > > > > > On Fri, Oct 9, 2009 at 9:40 AM, Avlesh Singh <
> avlesh@gmail.com
> > >
> > > > > wrote:
> > > > > > > >
> > > > > > > >> Use the field analysis tool to see how the data is being
> > > analyzed
> > > > in
> > > > > > > both
> > > > > > > >> the fields.
> > > > > > > >>
> > > > > > > >> Cheers
> > > > > > > >> Avlesh
> > > > > > > >>
> > > > > > > >> On Fri, Oct 9, 2009 at 12:56 AM, R. Tan <
> > tanrihaed58@gmail.com>
> > > > > > wrote:
> > > > > > > >>
> > > > > > > >> > Hmm... I don't quite get the desired results. Those
> starting
> > > > with
> > > > > > > "cha"
> > > > > > > >> are
> > > > > > > >> > now randomly ordered. Is there something wrong with the
> > > filters
> > > > I
> > > > > > > >> applied?
> > > > > > > >> >
> > > > > > > >> >
> > > > > > > >> > On Thu, Oct 8, 2009 at 7:38 PM, Avlesh Singh <
> > > avlesh@gmail.com>
> > > > > > > wrote:
> > > > > > > >> >
> > > > > > > >> > > Filters? I did not mean filters at all.
> > > > > > > >> > > I am in a mad rush right now, but on the face of it your
> > > field
> > > > > > > >> > definitions
> > > > > > > >> > > look right.
> > > > > > > >> > >
> > > > > > > >> > > This is what I asked for -
> > > > > > > >> > > q=(autoComplete2:cha^10 autoComplete:cha)
> > > > > > > >> > >
> > > > > > > >> > > Lemme know if this does not work for you.
> > > > > > > >> > >
> > > > > > > >> > > Cheers
> > > > > > > >> > > Avlesh
> > > > > > > >> > >
> > > > > > > >> > > On Thu, Oct 8, 2009 at 4:58 PM, R. Tan <
> > > tanrihaed58@gmail.com
> > > > >
> > > > > > > wrote:
> > > > > > > >> > >
> > > > > > > >> > > > Hi Avlesh,
> > > > > > > >> > > >
> > > > > > > >> > > > I can't seem to get the scores right.
> > > > > > > >> > > >
> > > > > > > >> > > > I now have these types for the fields I'm targeting,
> > > > > > > >> > > >
> > > > > > > >> > > > <fieldType name="autoComplete" class="solr.TextField"
> > > > > > > >> > > > positionIncrementGap="1">
> > > > > > > >> > > >      <analyzer type="index">
> > > > > > > >> > > >        <tokenizer
> > > class="solr.WhitespaceTokenizerFactory"/>
> > > > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > > > > > >> > > >        <filter class="solr.NGramFilterFactory"
> > > > minGramSize="1"
> > > > > > > >> > > > maxGramSize="20"/>
> > > > > > > >> > > >      </analyzer>
> > > > > > > >> > > >      <analyzer type="query">
> > > > > > > >> > > >        <tokenizer
> > > class="solr.WhitespaceTokenizerFactory"/>
> > > > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > > > > > >> > > >      </analyzer>
> > > > > > > >> > > >    </fieldType>
> > > > > > > >> > > >    <fieldType name="autoComplete2"
> > class="solr.TextField"
> > > > > > > >> > > > positionIncrementGap="1">
> > > > > > > >> > > >      <analyzer type="index">
> > > > > > > >> > > >        <tokenizer
> class="solr.KeywordTokenizerFactory"/>
> > > > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > > > > > >> > > >        <filter class="solr.NGramFilterFactory"
> > > > minGramSize="1"
> > > > > > > >> > > > maxGramSize="20"/>
> > > > > > > >> > > >      </analyzer>
> > > > > > > >> > > >      <analyzer type="query">
> > > > > > > >> > > >        <tokenizer
> class="solr.KeywordTokenizerFactory"/>
> > > > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > > > > > >> > > >      </analyzer>
> > > > > > > >> > > >    </fieldType>
> > > > > > > >> > > >
> > > > > > > >> > > > My query is this,
> > > > > > > >> > > >
> > > > > > > >> > > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> q=*:*&fq=autoCompleteHelper:cha+autoCompleteHelper2:cha&qf=autoCompleteHelper^10.0+autoCompleteHelper2^1.0
> > > > > > > >> > > >
> > > > > > > >> > > > What should I tweak from the above config and query?
> > > > > > > >> > > >
> > > > > > > >> > > > Thanks,
> > > > > > > >> > > > Rih
> > > > > > > >> > > >
> > > > > > > >> > > >
> > > > > > > >> > > > On Thu, Oct 8, 2009 at 4:38 PM, R. Tan <
> > > > tanrihaed58@gmail.com
> > > > > >
> > > > > > > >> wrote:
> > > > > > > >> > > >
> > > > > > > >> > > > > I will have to pass on this and try your suggestion
> > > first.
> > > > > So,
> > > > > > > how
> > > > > > > >> > does
> > > > > > > >> > > > > your suggestion (1 and 2) boost the my startswith
> > query?
> > > > Is
> > > > > it
> > > > > > > >> > because
> > > > > > > >> > > of
> > > > > > > >> > > > > the n-gram filter?
> > > > > > > >> > > > >
> > > > > > > >> > > > >
> > > > > > > >> > > > >
> > > > > > > >> > > > > On Thu, Oct 8, 2009 at 2:27 PM, Sandeep Tagore <
> > > > > > > >> > > sandeep.tagore@gmail.com
> > > > > > > >> > > > >wrote:
> > > > > > > >> > > > >
> > > > > > > >> > > > >>
> > > > > > > >> > > > >> Yes it can be done but it needs some customization.
> > > > Search
> > > > > > for
> > > > > > > >> > custom
> > > > > > > >> > > > sort
> > > > > > > >> > > > >> implementations/discussions.
> > > > > > > >> > > > >> You can check...
> > > > > > > >> > > > >>
> > > > > > > >> > > > >>
> > > > > > > >> > > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html
> > > > > > > >> > > > >> .
> > > > > > > >> > > > >> Let us know if you have any issues.
> > > > > > > >> > > > >>
> > > > > > > >> > > > >> Sandeep
> > > > > > > >> > > > >>
> > > > > > > >> > > > >>
> > > > > > > >> > > > >> R. Tan wrote:
> > > > > > > >> > > > >> >
> > > > > > > >> > > > >> > This might work and I also have a single value
> > field
> > > > > which
> > > > > > > >> makes
> > > > > > > >> > it
> > > > > > > >> > > > >> > cleaner.
> > > > > > > >> > > > >> > Can sort be customized (with indexOf()) from the
> > solr
> > > > > > > >> parameters
> > > > > > > >> > > > alone?
> > > > > > > >> > > > >> >
> > > > > > > >> > > > >>
> > > > > > > >> > > > >> --
> > > > > > > >> > > > >> View this message in context:
> > > > > > > >> > > > >>
> > > > > > > >> > > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25799055.html
> > > > > > > >> > > > >> Sent from the Solr - User mailing list archive at
> > > > > Nabble.com.
> > > > > > > >> > > > >>
> > > > > > > >> > > > >>
> > > > > > > >> > > > >
> > > > > > > >> > > >
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: Scoring for specific field queries

Posted by "R. Tan" <ta...@gmail.com>.
Thanks, I'll give this a go. What are the replacements for, the special
character and 20 char? Also, do you get results such as "XXXX formula"?

On Fri, Oct 9, 2009 at 3:45 PM, Avlesh Singh <av...@gmail.com> wrote:

> I have a very similar set-up for my auto-suggest (I am sorry that it can't
> be viewed from an external network).
> I am sending you my field definitions, please use them and see if it works
> out correctly.
>
> <fieldType name="autocomplete" class="solr.TextField">
>     <analyzer type="index">
>        <tokenizer class="solr.KeywordTokenizerFactory"/>
>        <filter class="solr.LowerCaseFilterFactory" />
>         <filter class="solr.PatternReplaceFilterFactory"
> pattern="([^a-z0-9])" replacement="" replace="all" />
>        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>        <filter class="solr.EdgeNGramFilterFactory" maxGramSize="100"
> minGramSize="1" />
>     </analyzer>
>    <analyzer type="query">
>        <tokenizer class="solr.KeywordTokenizerFactory"/>
>        <filter class="solr.LowerCaseFilterFactory" />
>         <filter class="solr.PatternReplaceFilterFactory"
> pattern="([^a-z0-9])" replacement="" replace="all" />
>        <filter class="solr.PatternReplaceFilterFactory"
> pattern="^(.{20})(.*)?" replacement="$1" replace="all" />
>        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>    </analyzer>
> </fieldType>
>
> <fieldType name="tokenized_autocomplete" class="solr.TextField">
>     <analyzer type="index">
>        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>        <filter class="solr.LowerCaseFilterFactory" />
>         <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>        <filter class="solr.EdgeNGramFilterFactory" maxGramSize="100"
> minGramSize="1" />
>     </analyzer>
>    <analyzer type="query">
>        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>        <filter class="solr.LowerCaseFilterFactory" />
>         <filter class="solr.PatternReplaceFilterFactory"
> pattern="([^a-z0-9])" replacement="" replace="all" />
>        <filter class="solr.PatternReplaceFilterFactory"
> pattern="^(.{20})(.*)?" replacement="$1" replace="all" />
>        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>    </analyzer>
> </fieldType>
>
> <field name="suggestion" type="autocomplete" indexed="true"
> stored="false"/>
> <field name="tokenized_suggestion" type="tokenized_autocomplete"
> indexed="true" stored="true"/>
>
> q=(suggestion:formula^2 tokenized_suggestion:formula)
>
> Hope this helps.
>
> Cheers
> Avlesh
>
> On Fri, Oct 9, 2009 at 1:03 PM, R. Tan <ta...@gmail.com> wrote:
>
> > Yeah, I do get results. Anything else I missed out?
> > I want it to work like this site's auto suggest feature.
> >
> > http://www.sematext.com/demo/ac/index.html
> >
> > Try the keyword 'formula'.
> >
> > Thanks,
> > Rih
> >
> >
> > On Fri, Oct 9, 2009 at 3:24 PM, Avlesh Singh <av...@gmail.com> wrote:
> >
> > > Can you just do q=autoCompleteHelper2:caf to see you get results?
> > >
> > > Cheers
> > > Avlesh
> > >
> > > On Fri, Oct 9, 2009 at 12:53 PM, R. Tan <ta...@gmail.com> wrote:
> > >
> > > > Yup, it is. Both are copied from another field called name.
> > > >
> > > > On Fri, Oct 9, 2009 at 3:15 PM, Avlesh Singh <av...@gmail.com>
> wrote:
> > > >
> > > > > Lame question, but are you populating data in the
> autoCompleteHelper2
> > > > > field?
> > > > >
> > > > > Cheers
> > > > > Avlesh
> > > > >
> > > > > On Fri, Oct 9, 2009 at 12:36 PM, R. Tan <ta...@gmail.com>
> > wrote:
> > > > >
> > > > > > The problem is, I'm getting equal scores for this:
> > > > > > Query:
> > > > > > q=(autoCompleteHelper2:caf^10.0 autoCompleteHelper:caf)
> > > > > >
> > > > > > Partial Result:
> > > > > >
> > > > > > <doc>
> > > > > > <float name="score">0.7821733</float>
> > > > > > <str name="autoCompleteHelper">Bikes Café</str>
> > > > > > </doc>
> > > > > >
> > > > > > <doc>
> > > > > > <float name="score">0.7821733</float>
> > > > > > <str name="autoCompleteHelper">Cafe Feliy</str>
> > > > > > </doc>
> > > > > >
> > > > > > I'm using the standard request handler with this.
> > > > > >
> > > > > > Thanks,
> > > > > > Rih
> > > > > >
> > > > > >
> > > > > > On Fri, Oct 9, 2009 at 3:02 PM, R. Tan <ta...@gmail.com>
> > > wrote:
> > > > > >
> > > > > > > Avlesh,
> > > > > > > I don't see anything wrong with the data from analysis.
> > > > > > >
> > > > > > > KeywordTokenized:
> > > > > > >
> > > > > > > *term position ** **1** **2** **3** **4** **5** **6** **7**
> **8**
> > > > **9**
> > > > > > **
> > > > > > > 10** **11** **12** **13** **14** **15** **16** **...*
> > > > > > > *term text ** **th** **he** **e ** **c** **ch** **ha** **am**
> > > **mp**
> > > > > > **pi*
> > > > > > > * **io** **on** **the** **he ** **e c** **ch** **cha** **...*
> > > > > > > *term type ** **word** **word** **word** **word** **word**
> > **word**
> > > > > > **word
> > > > > > > ** **word** **word** **word** **word** **word** **word**
> **word**
> > > > > > **word**
> > > > > > > **word** **...*
> > > > > > > *source start,end ** **0,2** **1,3** **2,4** **3,5** **4,6**
> > > **5,7**
> > > > > > **6,8
> > > > > > > ** **7,9** **8,10** **9,11** **10,12** **0,3** **1,4** **2,5**
> > > > **3,6**
> > > > > **
> > > > > > > ...*
> > > > > > >
> > > > > > > WhitespaceTokenized:
> > > > > > >
> > > > > > > *term position ** **1** **2** **3** **4** **5** **6** **7**
> **8**
> > > > **9**
> > > > > > **
> > > > > > > 10** **11** **...*
> > > > > > > *term text ** **th** **he** **the** **ch** **ha** **am** **mp**
> > > > **pi**
> > > > > **
> > > > > > > io** **on** **cha** **...*
> > > > > > > *term type ** **word** **word** **word** **word** **word**
> > **word**
> > > > > > **word
> > > > > > > ** **word** **word** **word** **word** **...*
> > > > > > > *source start,end ** **0,2** **1,3** **0,3** **0,2** **1,3**
> > > **2,4**
> > > > > > **3,5
> > > > > > > ** **4,6** **5,7** **6,8** **...*
> > > > > > >
> > > > > > > Is term position considered during scoring?
> > > > > > >
> > > > > > > Thanks,
> > > > > > > Rih
> > > > > > >
> > > > > > >
> > > > > > > On Fri, Oct 9, 2009 at 9:40 AM, Avlesh Singh <avlesh@gmail.com
> >
> > > > wrote:
> > > > > > >
> > > > > > >> Use the field analysis tool to see how the data is being
> > analyzed
> > > in
> > > > > > both
> > > > > > >> the fields.
> > > > > > >>
> > > > > > >> Cheers
> > > > > > >> Avlesh
> > > > > > >>
> > > > > > >> On Fri, Oct 9, 2009 at 12:56 AM, R. Tan <
> tanrihaed58@gmail.com>
> > > > > wrote:
> > > > > > >>
> > > > > > >> > Hmm... I don't quite get the desired results. Those starting
> > > with
> > > > > > "cha"
> > > > > > >> are
> > > > > > >> > now randomly ordered. Is there something wrong with the
> > filters
> > > I
> > > > > > >> applied?
> > > > > > >> >
> > > > > > >> >
> > > > > > >> > On Thu, Oct 8, 2009 at 7:38 PM, Avlesh Singh <
> > avlesh@gmail.com>
> > > > > > wrote:
> > > > > > >> >
> > > > > > >> > > Filters? I did not mean filters at all.
> > > > > > >> > > I am in a mad rush right now, but on the face of it your
> > field
> > > > > > >> > definitions
> > > > > > >> > > look right.
> > > > > > >> > >
> > > > > > >> > > This is what I asked for -
> > > > > > >> > > q=(autoComplete2:cha^10 autoComplete:cha)
> > > > > > >> > >
> > > > > > >> > > Lemme know if this does not work for you.
> > > > > > >> > >
> > > > > > >> > > Cheers
> > > > > > >> > > Avlesh
> > > > > > >> > >
> > > > > > >> > > On Thu, Oct 8, 2009 at 4:58 PM, R. Tan <
> > tanrihaed58@gmail.com
> > > >
> > > > > > wrote:
> > > > > > >> > >
> > > > > > >> > > > Hi Avlesh,
> > > > > > >> > > >
> > > > > > >> > > > I can't seem to get the scores right.
> > > > > > >> > > >
> > > > > > >> > > > I now have these types for the fields I'm targeting,
> > > > > > >> > > >
> > > > > > >> > > > <fieldType name="autoComplete" class="solr.TextField"
> > > > > > >> > > > positionIncrementGap="1">
> > > > > > >> > > >      <analyzer type="index">
> > > > > > >> > > >        <tokenizer
> > class="solr.WhitespaceTokenizerFactory"/>
> > > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > > > > >> > > >        <filter class="solr.NGramFilterFactory"
> > > minGramSize="1"
> > > > > > >> > > > maxGramSize="20"/>
> > > > > > >> > > >      </analyzer>
> > > > > > >> > > >      <analyzer type="query">
> > > > > > >> > > >        <tokenizer
> > class="solr.WhitespaceTokenizerFactory"/>
> > > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > > > > >> > > >      </analyzer>
> > > > > > >> > > >    </fieldType>
> > > > > > >> > > >    <fieldType name="autoComplete2"
> class="solr.TextField"
> > > > > > >> > > > positionIncrementGap="1">
> > > > > > >> > > >      <analyzer type="index">
> > > > > > >> > > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> > > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > > > > >> > > >        <filter class="solr.NGramFilterFactory"
> > > minGramSize="1"
> > > > > > >> > > > maxGramSize="20"/>
> > > > > > >> > > >      </analyzer>
> > > > > > >> > > >      <analyzer type="query">
> > > > > > >> > > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> > > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > > > > >> > > >      </analyzer>
> > > > > > >> > > >    </fieldType>
> > > > > > >> > > >
> > > > > > >> > > > My query is this,
> > > > > > >> > > >
> > > > > > >> > > >
> > > > > > >> > >
> > > > > > >> >
> > > > > > >>
> > > > > >
> > > > >
> > > >
> > >
> >
> q=*:*&fq=autoCompleteHelper:cha+autoCompleteHelper2:cha&qf=autoCompleteHelper^10.0+autoCompleteHelper2^1.0
> > > > > > >> > > >
> > > > > > >> > > > What should I tweak from the above config and query?
> > > > > > >> > > >
> > > > > > >> > > > Thanks,
> > > > > > >> > > > Rih
> > > > > > >> > > >
> > > > > > >> > > >
> > > > > > >> > > > On Thu, Oct 8, 2009 at 4:38 PM, R. Tan <
> > > tanrihaed58@gmail.com
> > > > >
> > > > > > >> wrote:
> > > > > > >> > > >
> > > > > > >> > > > > I will have to pass on this and try your suggestion
> > first.
> > > > So,
> > > > > > how
> > > > > > >> > does
> > > > > > >> > > > > your suggestion (1 and 2) boost the my startswith
> query?
> > > Is
> > > > it
> > > > > > >> > because
> > > > > > >> > > of
> > > > > > >> > > > > the n-gram filter?
> > > > > > >> > > > >
> > > > > > >> > > > >
> > > > > > >> > > > >
> > > > > > >> > > > > On Thu, Oct 8, 2009 at 2:27 PM, Sandeep Tagore <
> > > > > > >> > > sandeep.tagore@gmail.com
> > > > > > >> > > > >wrote:
> > > > > > >> > > > >
> > > > > > >> > > > >>
> > > > > > >> > > > >> Yes it can be done but it needs some customization.
> > > Search
> > > > > for
> > > > > > >> > custom
> > > > > > >> > > > sort
> > > > > > >> > > > >> implementations/discussions.
> > > > > > >> > > > >> You can check...
> > > > > > >> > > > >>
> > > > > > >> > > > >>
> > > > > > >> > > >
> > > > > > >> > >
> > > > > > >> >
> > > > > > >>
> > > > > >
> > > > >
> > > >
> > >
> >
> http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html
> > > > > > >> > > > >> .
> > > > > > >> > > > >> Let us know if you have any issues.
> > > > > > >> > > > >>
> > > > > > >> > > > >> Sandeep
> > > > > > >> > > > >>
> > > > > > >> > > > >>
> > > > > > >> > > > >> R. Tan wrote:
> > > > > > >> > > > >> >
> > > > > > >> > > > >> > This might work and I also have a single value
> field
> > > > which
> > > > > > >> makes
> > > > > > >> > it
> > > > > > >> > > > >> > cleaner.
> > > > > > >> > > > >> > Can sort be customized (with indexOf()) from the
> solr
> > > > > > >> parameters
> > > > > > >> > > > alone?
> > > > > > >> > > > >> >
> > > > > > >> > > > >>
> > > > > > >> > > > >> --
> > > > > > >> > > > >> View this message in context:
> > > > > > >> > > > >>
> > > > > > >> > > >
> > > > > > >> > >
> > > > > > >> >
> > > > > > >>
> > > > > >
> > > > >
> > > >
> > >
> >
> http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25799055.html
> > > > > > >> > > > >> Sent from the Solr - User mailing list archive at
> > > > Nabble.com.
> > > > > > >> > > > >>
> > > > > > >> > > > >>
> > > > > > >> > > > >
> > > > > > >> > > >
> > > > > > >> > >
> > > > > > >> >
> > > > > > >>
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: Scoring for specific field queries

Posted by Avlesh Singh <av...@gmail.com>.
I have a very similar set-up for my auto-suggest (I am sorry that it can't
be viewed from an external network).
I am sending you my field definitions, please use them and see if it works
out correctly.

<fieldType name="autocomplete" class="solr.TextField">
    <analyzer type="index">
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory" />
        <filter class="solr.PatternReplaceFilterFactory"
pattern="([^a-z0-9])" replacement="" replace="all" />
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
        <filter class="solr.EdgeNGramFilterFactory" maxGramSize="100"
minGramSize="1" />
    </analyzer>
    <analyzer type="query">
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory" />
        <filter class="solr.PatternReplaceFilterFactory"
pattern="([^a-z0-9])" replacement="" replace="all" />
        <filter class="solr.PatternReplaceFilterFactory"
pattern="^(.{20})(.*)?" replacement="$1" replace="all" />
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
    </analyzer>
</fieldType>

<fieldType name="tokenized_autocomplete" class="solr.TextField">
    <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory" />
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
        <filter class="solr.EdgeNGramFilterFactory" maxGramSize="100"
minGramSize="1" />
    </analyzer>
    <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory" />
        <filter class="solr.PatternReplaceFilterFactory"
pattern="([^a-z0-9])" replacement="" replace="all" />
        <filter class="solr.PatternReplaceFilterFactory"
pattern="^(.{20})(.*)?" replacement="$1" replace="all" />
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
    </analyzer>
</fieldType>

<field name="suggestion" type="autocomplete" indexed="true" stored="false"/>
<field name="tokenized_suggestion" type="tokenized_autocomplete"
indexed="true" stored="true"/>

q=(suggestion:formula^2 tokenized_suggestion:formula)

Hope this helps.

Cheers
Avlesh

On Fri, Oct 9, 2009 at 1:03 PM, R. Tan <ta...@gmail.com> wrote:

> Yeah, I do get results. Anything else I missed out?
> I want it to work like this site's auto suggest feature.
>
> http://www.sematext.com/demo/ac/index.html
>
> Try the keyword 'formula'.
>
> Thanks,
> Rih
>
>
> On Fri, Oct 9, 2009 at 3:24 PM, Avlesh Singh <av...@gmail.com> wrote:
>
> > Can you just do q=autoCompleteHelper2:caf to see you get results?
> >
> > Cheers
> > Avlesh
> >
> > On Fri, Oct 9, 2009 at 12:53 PM, R. Tan <ta...@gmail.com> wrote:
> >
> > > Yup, it is. Both are copied from another field called name.
> > >
> > > On Fri, Oct 9, 2009 at 3:15 PM, Avlesh Singh <av...@gmail.com> wrote:
> > >
> > > > Lame question, but are you populating data in the autoCompleteHelper2
> > > > field?
> > > >
> > > > Cheers
> > > > Avlesh
> > > >
> > > > On Fri, Oct 9, 2009 at 12:36 PM, R. Tan <ta...@gmail.com>
> wrote:
> > > >
> > > > > The problem is, I'm getting equal scores for this:
> > > > > Query:
> > > > > q=(autoCompleteHelper2:caf^10.0 autoCompleteHelper:caf)
> > > > >
> > > > > Partial Result:
> > > > >
> > > > > <doc>
> > > > > <float name="score">0.7821733</float>
> > > > > <str name="autoCompleteHelper">Bikes Café</str>
> > > > > </doc>
> > > > >
> > > > > <doc>
> > > > > <float name="score">0.7821733</float>
> > > > > <str name="autoCompleteHelper">Cafe Feliy</str>
> > > > > </doc>
> > > > >
> > > > > I'm using the standard request handler with this.
> > > > >
> > > > > Thanks,
> > > > > Rih
> > > > >
> > > > >
> > > > > On Fri, Oct 9, 2009 at 3:02 PM, R. Tan <ta...@gmail.com>
> > wrote:
> > > > >
> > > > > > Avlesh,
> > > > > > I don't see anything wrong with the data from analysis.
> > > > > >
> > > > > > KeywordTokenized:
> > > > > >
> > > > > > *term position ** **1** **2** **3** **4** **5** **6** **7** **8**
> > > **9**
> > > > > **
> > > > > > 10** **11** **12** **13** **14** **15** **16** **...*
> > > > > > *term text ** **th** **he** **e ** **c** **ch** **ha** **am**
> > **mp**
> > > > > **pi*
> > > > > > * **io** **on** **the** **he ** **e c** **ch** **cha** **...*
> > > > > > *term type ** **word** **word** **word** **word** **word**
> **word**
> > > > > **word
> > > > > > ** **word** **word** **word** **word** **word** **word** **word**
> > > > > **word**
> > > > > > **word** **...*
> > > > > > *source start,end ** **0,2** **1,3** **2,4** **3,5** **4,6**
> > **5,7**
> > > > > **6,8
> > > > > > ** **7,9** **8,10** **9,11** **10,12** **0,3** **1,4** **2,5**
> > > **3,6**
> > > > **
> > > > > > ...*
> > > > > >
> > > > > > WhitespaceTokenized:
> > > > > >
> > > > > > *term position ** **1** **2** **3** **4** **5** **6** **7** **8**
> > > **9**
> > > > > **
> > > > > > 10** **11** **...*
> > > > > > *term text ** **th** **he** **the** **ch** **ha** **am** **mp**
> > > **pi**
> > > > **
> > > > > > io** **on** **cha** **...*
> > > > > > *term type ** **word** **word** **word** **word** **word**
> **word**
> > > > > **word
> > > > > > ** **word** **word** **word** **word** **...*
> > > > > > *source start,end ** **0,2** **1,3** **0,3** **0,2** **1,3**
> > **2,4**
> > > > > **3,5
> > > > > > ** **4,6** **5,7** **6,8** **...*
> > > > > >
> > > > > > Is term position considered during scoring?
> > > > > >
> > > > > > Thanks,
> > > > > > Rih
> > > > > >
> > > > > >
> > > > > > On Fri, Oct 9, 2009 at 9:40 AM, Avlesh Singh <av...@gmail.com>
> > > wrote:
> > > > > >
> > > > > >> Use the field analysis tool to see how the data is being
> analyzed
> > in
> > > > > both
> > > > > >> the fields.
> > > > > >>
> > > > > >> Cheers
> > > > > >> Avlesh
> > > > > >>
> > > > > >> On Fri, Oct 9, 2009 at 12:56 AM, R. Tan <ta...@gmail.com>
> > > > wrote:
> > > > > >>
> > > > > >> > Hmm... I don't quite get the desired results. Those starting
> > with
> > > > > "cha"
> > > > > >> are
> > > > > >> > now randomly ordered. Is there something wrong with the
> filters
> > I
> > > > > >> applied?
> > > > > >> >
> > > > > >> >
> > > > > >> > On Thu, Oct 8, 2009 at 7:38 PM, Avlesh Singh <
> avlesh@gmail.com>
> > > > > wrote:
> > > > > >> >
> > > > > >> > > Filters? I did not mean filters at all.
> > > > > >> > > I am in a mad rush right now, but on the face of it your
> field
> > > > > >> > definitions
> > > > > >> > > look right.
> > > > > >> > >
> > > > > >> > > This is what I asked for -
> > > > > >> > > q=(autoComplete2:cha^10 autoComplete:cha)
> > > > > >> > >
> > > > > >> > > Lemme know if this does not work for you.
> > > > > >> > >
> > > > > >> > > Cheers
> > > > > >> > > Avlesh
> > > > > >> > >
> > > > > >> > > On Thu, Oct 8, 2009 at 4:58 PM, R. Tan <
> tanrihaed58@gmail.com
> > >
> > > > > wrote:
> > > > > >> > >
> > > > > >> > > > Hi Avlesh,
> > > > > >> > > >
> > > > > >> > > > I can't seem to get the scores right.
> > > > > >> > > >
> > > > > >> > > > I now have these types for the fields I'm targeting,
> > > > > >> > > >
> > > > > >> > > > <fieldType name="autoComplete" class="solr.TextField"
> > > > > >> > > > positionIncrementGap="1">
> > > > > >> > > >      <analyzer type="index">
> > > > > >> > > >        <tokenizer
> class="solr.WhitespaceTokenizerFactory"/>
> > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > > > >> > > >        <filter class="solr.NGramFilterFactory"
> > minGramSize="1"
> > > > > >> > > > maxGramSize="20"/>
> > > > > >> > > >      </analyzer>
> > > > > >> > > >      <analyzer type="query">
> > > > > >> > > >        <tokenizer
> class="solr.WhitespaceTokenizerFactory"/>
> > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > > > >> > > >      </analyzer>
> > > > > >> > > >    </fieldType>
> > > > > >> > > >    <fieldType name="autoComplete2" class="solr.TextField"
> > > > > >> > > > positionIncrementGap="1">
> > > > > >> > > >      <analyzer type="index">
> > > > > >> > > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > > > >> > > >        <filter class="solr.NGramFilterFactory"
> > minGramSize="1"
> > > > > >> > > > maxGramSize="20"/>
> > > > > >> > > >      </analyzer>
> > > > > >> > > >      <analyzer type="query">
> > > > > >> > > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> > > > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > > > >> > > >      </analyzer>
> > > > > >> > > >    </fieldType>
> > > > > >> > > >
> > > > > >> > > > My query is this,
> > > > > >> > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> q=*:*&fq=autoCompleteHelper:cha+autoCompleteHelper2:cha&qf=autoCompleteHelper^10.0+autoCompleteHelper2^1.0
> > > > > >> > > >
> > > > > >> > > > What should I tweak from the above config and query?
> > > > > >> > > >
> > > > > >> > > > Thanks,
> > > > > >> > > > Rih
> > > > > >> > > >
> > > > > >> > > >
> > > > > >> > > > On Thu, Oct 8, 2009 at 4:38 PM, R. Tan <
> > tanrihaed58@gmail.com
> > > >
> > > > > >> wrote:
> > > > > >> > > >
> > > > > >> > > > > I will have to pass on this and try your suggestion
> first.
> > > So,
> > > > > how
> > > > > >> > does
> > > > > >> > > > > your suggestion (1 and 2) boost the my startswith query?
> > Is
> > > it
> > > > > >> > because
> > > > > >> > > of
> > > > > >> > > > > the n-gram filter?
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > > >
> > > > > >> > > > > On Thu, Oct 8, 2009 at 2:27 PM, Sandeep Tagore <
> > > > > >> > > sandeep.tagore@gmail.com
> > > > > >> > > > >wrote:
> > > > > >> > > > >
> > > > > >> > > > >>
> > > > > >> > > > >> Yes it can be done but it needs some customization.
> > Search
> > > > for
> > > > > >> > custom
> > > > > >> > > > sort
> > > > > >> > > > >> implementations/discussions.
> > > > > >> > > > >> You can check...
> > > > > >> > > > >>
> > > > > >> > > > >>
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html
> > > > > >> > > > >> .
> > > > > >> > > > >> Let us know if you have any issues.
> > > > > >> > > > >>
> > > > > >> > > > >> Sandeep
> > > > > >> > > > >>
> > > > > >> > > > >>
> > > > > >> > > > >> R. Tan wrote:
> > > > > >> > > > >> >
> > > > > >> > > > >> > This might work and I also have a single value field
> > > which
> > > > > >> makes
> > > > > >> > it
> > > > > >> > > > >> > cleaner.
> > > > > >> > > > >> > Can sort be customized (with indexOf()) from the solr
> > > > > >> parameters
> > > > > >> > > > alone?
> > > > > >> > > > >> >
> > > > > >> > > > >>
> > > > > >> > > > >> --
> > > > > >> > > > >> View this message in context:
> > > > > >> > > > >>
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25799055.html
> > > > > >> > > > >> Sent from the Solr - User mailing list archive at
> > > Nabble.com.
> > > > > >> > > > >>
> > > > > >> > > > >>
> > > > > >> > > > >
> > > > > >> > > >
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: Scoring for specific field queries

Posted by "R. Tan" <ta...@gmail.com>.
Yeah, I do get results. Anything else I missed out?
I want it to work like this site's auto suggest feature.

http://www.sematext.com/demo/ac/index.html

Try the keyword 'formula'.

Thanks,
Rih


On Fri, Oct 9, 2009 at 3:24 PM, Avlesh Singh <av...@gmail.com> wrote:

> Can you just do q=autoCompleteHelper2:caf to see you get results?
>
> Cheers
> Avlesh
>
> On Fri, Oct 9, 2009 at 12:53 PM, R. Tan <ta...@gmail.com> wrote:
>
> > Yup, it is. Both are copied from another field called name.
> >
> > On Fri, Oct 9, 2009 at 3:15 PM, Avlesh Singh <av...@gmail.com> wrote:
> >
> > > Lame question, but are you populating data in the autoCompleteHelper2
> > > field?
> > >
> > > Cheers
> > > Avlesh
> > >
> > > On Fri, Oct 9, 2009 at 12:36 PM, R. Tan <ta...@gmail.com> wrote:
> > >
> > > > The problem is, I'm getting equal scores for this:
> > > > Query:
> > > > q=(autoCompleteHelper2:caf^10.0 autoCompleteHelper:caf)
> > > >
> > > > Partial Result:
> > > >
> > > > <doc>
> > > > <float name="score">0.7821733</float>
> > > > <str name="autoCompleteHelper">Bikes Café</str>
> > > > </doc>
> > > >
> > > > <doc>
> > > > <float name="score">0.7821733</float>
> > > > <str name="autoCompleteHelper">Cafe Feliy</str>
> > > > </doc>
> > > >
> > > > I'm using the standard request handler with this.
> > > >
> > > > Thanks,
> > > > Rih
> > > >
> > > >
> > > > On Fri, Oct 9, 2009 at 3:02 PM, R. Tan <ta...@gmail.com>
> wrote:
> > > >
> > > > > Avlesh,
> > > > > I don't see anything wrong with the data from analysis.
> > > > >
> > > > > KeywordTokenized:
> > > > >
> > > > > *term position ** **1** **2** **3** **4** **5** **6** **7** **8**
> > **9**
> > > > **
> > > > > 10** **11** **12** **13** **14** **15** **16** **...*
> > > > > *term text ** **th** **he** **e ** **c** **ch** **ha** **am**
> **mp**
> > > > **pi*
> > > > > * **io** **on** **the** **he ** **e c** **ch** **cha** **...*
> > > > > *term type ** **word** **word** **word** **word** **word** **word**
> > > > **word
> > > > > ** **word** **word** **word** **word** **word** **word** **word**
> > > > **word**
> > > > > **word** **...*
> > > > > *source start,end ** **0,2** **1,3** **2,4** **3,5** **4,6**
> **5,7**
> > > > **6,8
> > > > > ** **7,9** **8,10** **9,11** **10,12** **0,3** **1,4** **2,5**
> > **3,6**
> > > **
> > > > > ...*
> > > > >
> > > > > WhitespaceTokenized:
> > > > >
> > > > > *term position ** **1** **2** **3** **4** **5** **6** **7** **8**
> > **9**
> > > > **
> > > > > 10** **11** **...*
> > > > > *term text ** **th** **he** **the** **ch** **ha** **am** **mp**
> > **pi**
> > > **
> > > > > io** **on** **cha** **...*
> > > > > *term type ** **word** **word** **word** **word** **word** **word**
> > > > **word
> > > > > ** **word** **word** **word** **word** **...*
> > > > > *source start,end ** **0,2** **1,3** **0,3** **0,2** **1,3**
> **2,4**
> > > > **3,5
> > > > > ** **4,6** **5,7** **6,8** **...*
> > > > >
> > > > > Is term position considered during scoring?
> > > > >
> > > > > Thanks,
> > > > > Rih
> > > > >
> > > > >
> > > > > On Fri, Oct 9, 2009 at 9:40 AM, Avlesh Singh <av...@gmail.com>
> > wrote:
> > > > >
> > > > >> Use the field analysis tool to see how the data is being analyzed
> in
> > > > both
> > > > >> the fields.
> > > > >>
> > > > >> Cheers
> > > > >> Avlesh
> > > > >>
> > > > >> On Fri, Oct 9, 2009 at 12:56 AM, R. Tan <ta...@gmail.com>
> > > wrote:
> > > > >>
> > > > >> > Hmm... I don't quite get the desired results. Those starting
> with
> > > > "cha"
> > > > >> are
> > > > >> > now randomly ordered. Is there something wrong with the filters
> I
> > > > >> applied?
> > > > >> >
> > > > >> >
> > > > >> > On Thu, Oct 8, 2009 at 7:38 PM, Avlesh Singh <av...@gmail.com>
> > > > wrote:
> > > > >> >
> > > > >> > > Filters? I did not mean filters at all.
> > > > >> > > I am in a mad rush right now, but on the face of it your field
> > > > >> > definitions
> > > > >> > > look right.
> > > > >> > >
> > > > >> > > This is what I asked for -
> > > > >> > > q=(autoComplete2:cha^10 autoComplete:cha)
> > > > >> > >
> > > > >> > > Lemme know if this does not work for you.
> > > > >> > >
> > > > >> > > Cheers
> > > > >> > > Avlesh
> > > > >> > >
> > > > >> > > On Thu, Oct 8, 2009 at 4:58 PM, R. Tan <tanrihaed58@gmail.com
> >
> > > > wrote:
> > > > >> > >
> > > > >> > > > Hi Avlesh,
> > > > >> > > >
> > > > >> > > > I can't seem to get the scores right.
> > > > >> > > >
> > > > >> > > > I now have these types for the fields I'm targeting,
> > > > >> > > >
> > > > >> > > > <fieldType name="autoComplete" class="solr.TextField"
> > > > >> > > > positionIncrementGap="1">
> > > > >> > > >      <analyzer type="index">
> > > > >> > > >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> > > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > > >> > > >        <filter class="solr.NGramFilterFactory"
> minGramSize="1"
> > > > >> > > > maxGramSize="20"/>
> > > > >> > > >      </analyzer>
> > > > >> > > >      <analyzer type="query">
> > > > >> > > >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> > > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > > >> > > >      </analyzer>
> > > > >> > > >    </fieldType>
> > > > >> > > >    <fieldType name="autoComplete2" class="solr.TextField"
> > > > >> > > > positionIncrementGap="1">
> > > > >> > > >      <analyzer type="index">
> > > > >> > > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> > > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > > >> > > >        <filter class="solr.NGramFilterFactory"
> minGramSize="1"
> > > > >> > > > maxGramSize="20"/>
> > > > >> > > >      </analyzer>
> > > > >> > > >      <analyzer type="query">
> > > > >> > > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> > > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > > >> > > >      </analyzer>
> > > > >> > > >    </fieldType>
> > > > >> > > >
> > > > >> > > > My query is this,
> > > > >> > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> q=*:*&fq=autoCompleteHelper:cha+autoCompleteHelper2:cha&qf=autoCompleteHelper^10.0+autoCompleteHelper2^1.0
> > > > >> > > >
> > > > >> > > > What should I tweak from the above config and query?
> > > > >> > > >
> > > > >> > > > Thanks,
> > > > >> > > > Rih
> > > > >> > > >
> > > > >> > > >
> > > > >> > > > On Thu, Oct 8, 2009 at 4:38 PM, R. Tan <
> tanrihaed58@gmail.com
> > >
> > > > >> wrote:
> > > > >> > > >
> > > > >> > > > > I will have to pass on this and try your suggestion first.
> > So,
> > > > how
> > > > >> > does
> > > > >> > > > > your suggestion (1 and 2) boost the my startswith query?
> Is
> > it
> > > > >> > because
> > > > >> > > of
> > > > >> > > > > the n-gram filter?
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > > >
> > > > >> > > > > On Thu, Oct 8, 2009 at 2:27 PM, Sandeep Tagore <
> > > > >> > > sandeep.tagore@gmail.com
> > > > >> > > > >wrote:
> > > > >> > > > >
> > > > >> > > > >>
> > > > >> > > > >> Yes it can be done but it needs some customization.
> Search
> > > for
> > > > >> > custom
> > > > >> > > > sort
> > > > >> > > > >> implementations/discussions.
> > > > >> > > > >> You can check...
> > > > >> > > > >>
> > > > >> > > > >>
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html
> > > > >> > > > >> .
> > > > >> > > > >> Let us know if you have any issues.
> > > > >> > > > >>
> > > > >> > > > >> Sandeep
> > > > >> > > > >>
> > > > >> > > > >>
> > > > >> > > > >> R. Tan wrote:
> > > > >> > > > >> >
> > > > >> > > > >> > This might work and I also have a single value field
> > which
> > > > >> makes
> > > > >> > it
> > > > >> > > > >> > cleaner.
> > > > >> > > > >> > Can sort be customized (with indexOf()) from the solr
> > > > >> parameters
> > > > >> > > > alone?
> > > > >> > > > >> >
> > > > >> > > > >>
> > > > >> > > > >> --
> > > > >> > > > >> View this message in context:
> > > > >> > > > >>
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25799055.html
> > > > >> > > > >> Sent from the Solr - User mailing list archive at
> > Nabble.com.
> > > > >> > > > >>
> > > > >> > > > >>
> > > > >> > > > >
> > > > >> > > >
> > > > >> > >
> > > > >> >
> > > > >>
> > > > >
> > > > >
> > > >
> > >
> >
>

Re: Scoring for specific field queries

Posted by Avlesh Singh <av...@gmail.com>.
Can you just do q=autoCompleteHelper2:caf to see you get results?

Cheers
Avlesh

On Fri, Oct 9, 2009 at 12:53 PM, R. Tan <ta...@gmail.com> wrote:

> Yup, it is. Both are copied from another field called name.
>
> On Fri, Oct 9, 2009 at 3:15 PM, Avlesh Singh <av...@gmail.com> wrote:
>
> > Lame question, but are you populating data in the autoCompleteHelper2
> > field?
> >
> > Cheers
> > Avlesh
> >
> > On Fri, Oct 9, 2009 at 12:36 PM, R. Tan <ta...@gmail.com> wrote:
> >
> > > The problem is, I'm getting equal scores for this:
> > > Query:
> > > q=(autoCompleteHelper2:caf^10.0 autoCompleteHelper:caf)
> > >
> > > Partial Result:
> > >
> > > <doc>
> > > <float name="score">0.7821733</float>
> > > <str name="autoCompleteHelper">Bikes Café</str>
> > > </doc>
> > >
> > > <doc>
> > > <float name="score">0.7821733</float>
> > > <str name="autoCompleteHelper">Cafe Feliy</str>
> > > </doc>
> > >
> > > I'm using the standard request handler with this.
> > >
> > > Thanks,
> > > Rih
> > >
> > >
> > > On Fri, Oct 9, 2009 at 3:02 PM, R. Tan <ta...@gmail.com> wrote:
> > >
> > > > Avlesh,
> > > > I don't see anything wrong with the data from analysis.
> > > >
> > > > KeywordTokenized:
> > > >
> > > > *term position ** **1** **2** **3** **4** **5** **6** **7** **8**
> **9**
> > > **
> > > > 10** **11** **12** **13** **14** **15** **16** **...*
> > > > *term text ** **th** **he** **e ** **c** **ch** **ha** **am** **mp**
> > > **pi*
> > > > * **io** **on** **the** **he ** **e c** **ch** **cha** **...*
> > > > *term type ** **word** **word** **word** **word** **word** **word**
> > > **word
> > > > ** **word** **word** **word** **word** **word** **word** **word**
> > > **word**
> > > > **word** **...*
> > > > *source start,end ** **0,2** **1,3** **2,4** **3,5** **4,6** **5,7**
> > > **6,8
> > > > ** **7,9** **8,10** **9,11** **10,12** **0,3** **1,4** **2,5**
> **3,6**
> > **
> > > > ...*
> > > >
> > > > WhitespaceTokenized:
> > > >
> > > > *term position ** **1** **2** **3** **4** **5** **6** **7** **8**
> **9**
> > > **
> > > > 10** **11** **...*
> > > > *term text ** **th** **he** **the** **ch** **ha** **am** **mp**
> **pi**
> > **
> > > > io** **on** **cha** **...*
> > > > *term type ** **word** **word** **word** **word** **word** **word**
> > > **word
> > > > ** **word** **word** **word** **word** **...*
> > > > *source start,end ** **0,2** **1,3** **0,3** **0,2** **1,3** **2,4**
> > > **3,5
> > > > ** **4,6** **5,7** **6,8** **...*
> > > >
> > > > Is term position considered during scoring?
> > > >
> > > > Thanks,
> > > > Rih
> > > >
> > > >
> > > > On Fri, Oct 9, 2009 at 9:40 AM, Avlesh Singh <av...@gmail.com>
> wrote:
> > > >
> > > >> Use the field analysis tool to see how the data is being analyzed in
> > > both
> > > >> the fields.
> > > >>
> > > >> Cheers
> > > >> Avlesh
> > > >>
> > > >> On Fri, Oct 9, 2009 at 12:56 AM, R. Tan <ta...@gmail.com>
> > wrote:
> > > >>
> > > >> > Hmm... I don't quite get the desired results. Those starting with
> > > "cha"
> > > >> are
> > > >> > now randomly ordered. Is there something wrong with the filters I
> > > >> applied?
> > > >> >
> > > >> >
> > > >> > On Thu, Oct 8, 2009 at 7:38 PM, Avlesh Singh <av...@gmail.com>
> > > wrote:
> > > >> >
> > > >> > > Filters? I did not mean filters at all.
> > > >> > > I am in a mad rush right now, but on the face of it your field
> > > >> > definitions
> > > >> > > look right.
> > > >> > >
> > > >> > > This is what I asked for -
> > > >> > > q=(autoComplete2:cha^10 autoComplete:cha)
> > > >> > >
> > > >> > > Lemme know if this does not work for you.
> > > >> > >
> > > >> > > Cheers
> > > >> > > Avlesh
> > > >> > >
> > > >> > > On Thu, Oct 8, 2009 at 4:58 PM, R. Tan <ta...@gmail.com>
> > > wrote:
> > > >> > >
> > > >> > > > Hi Avlesh,
> > > >> > > >
> > > >> > > > I can't seem to get the scores right.
> > > >> > > >
> > > >> > > > I now have these types for the fields I'm targeting,
> > > >> > > >
> > > >> > > > <fieldType name="autoComplete" class="solr.TextField"
> > > >> > > > positionIncrementGap="1">
> > > >> > > >      <analyzer type="index">
> > > >> > > >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > >> > > >        <filter class="solr.NGramFilterFactory" minGramSize="1"
> > > >> > > > maxGramSize="20"/>
> > > >> > > >      </analyzer>
> > > >> > > >      <analyzer type="query">
> > > >> > > >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > >> > > >      </analyzer>
> > > >> > > >    </fieldType>
> > > >> > > >    <fieldType name="autoComplete2" class="solr.TextField"
> > > >> > > > positionIncrementGap="1">
> > > >> > > >      <analyzer type="index">
> > > >> > > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > >> > > >        <filter class="solr.NGramFilterFactory" minGramSize="1"
> > > >> > > > maxGramSize="20"/>
> > > >> > > >      </analyzer>
> > > >> > > >      <analyzer type="query">
> > > >> > > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> > > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > >> > > >      </analyzer>
> > > >> > > >    </fieldType>
> > > >> > > >
> > > >> > > > My query is this,
> > > >> > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> q=*:*&fq=autoCompleteHelper:cha+autoCompleteHelper2:cha&qf=autoCompleteHelper^10.0+autoCompleteHelper2^1.0
> > > >> > > >
> > > >> > > > What should I tweak from the above config and query?
> > > >> > > >
> > > >> > > > Thanks,
> > > >> > > > Rih
> > > >> > > >
> > > >> > > >
> > > >> > > > On Thu, Oct 8, 2009 at 4:38 PM, R. Tan <tanrihaed58@gmail.com
> >
> > > >> wrote:
> > > >> > > >
> > > >> > > > > I will have to pass on this and try your suggestion first.
> So,
> > > how
> > > >> > does
> > > >> > > > > your suggestion (1 and 2) boost the my startswith query? Is
> it
> > > >> > because
> > > >> > > of
> > > >> > > > > the n-gram filter?
> > > >> > > > >
> > > >> > > > >
> > > >> > > > >
> > > >> > > > > On Thu, Oct 8, 2009 at 2:27 PM, Sandeep Tagore <
> > > >> > > sandeep.tagore@gmail.com
> > > >> > > > >wrote:
> > > >> > > > >
> > > >> > > > >>
> > > >> > > > >> Yes it can be done but it needs some customization. Search
> > for
> > > >> > custom
> > > >> > > > sort
> > > >> > > > >> implementations/discussions.
> > > >> > > > >> You can check...
> > > >> > > > >>
> > > >> > > > >>
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html
> > > >> > > > >> .
> > > >> > > > >> Let us know if you have any issues.
> > > >> > > > >>
> > > >> > > > >> Sandeep
> > > >> > > > >>
> > > >> > > > >>
> > > >> > > > >> R. Tan wrote:
> > > >> > > > >> >
> > > >> > > > >> > This might work and I also have a single value field
> which
> > > >> makes
> > > >> > it
> > > >> > > > >> > cleaner.
> > > >> > > > >> > Can sort be customized (with indexOf()) from the solr
> > > >> parameters
> > > >> > > > alone?
> > > >> > > > >> >
> > > >> > > > >>
> > > >> > > > >> --
> > > >> > > > >> View this message in context:
> > > >> > > > >>
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25799055.html
> > > >> > > > >> Sent from the Solr - User mailing list archive at
> Nabble.com.
> > > >> > > > >>
> > > >> > > > >>
> > > >> > > > >
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > > >
> > > >
> > >
> >
>

Re: Scoring for specific field queries

Posted by "R. Tan" <ta...@gmail.com>.
Yup, it is. Both are copied from another field called name.

On Fri, Oct 9, 2009 at 3:15 PM, Avlesh Singh <av...@gmail.com> wrote:

> Lame question, but are you populating data in the autoCompleteHelper2
> field?
>
> Cheers
> Avlesh
>
> On Fri, Oct 9, 2009 at 12:36 PM, R. Tan <ta...@gmail.com> wrote:
>
> > The problem is, I'm getting equal scores for this:
> > Query:
> > q=(autoCompleteHelper2:caf^10.0 autoCompleteHelper:caf)
> >
> > Partial Result:
> >
> > <doc>
> > <float name="score">0.7821733</float>
> > <str name="autoCompleteHelper">Bikes Café</str>
> > </doc>
> >
> > <doc>
> > <float name="score">0.7821733</float>
> > <str name="autoCompleteHelper">Cafe Feliy</str>
> > </doc>
> >
> > I'm using the standard request handler with this.
> >
> > Thanks,
> > Rih
> >
> >
> > On Fri, Oct 9, 2009 at 3:02 PM, R. Tan <ta...@gmail.com> wrote:
> >
> > > Avlesh,
> > > I don't see anything wrong with the data from analysis.
> > >
> > > KeywordTokenized:
> > >
> > > *term position ** **1** **2** **3** **4** **5** **6** **7** **8** **9**
> > **
> > > 10** **11** **12** **13** **14** **15** **16** **...*
> > > *term text ** **th** **he** **e ** **c** **ch** **ha** **am** **mp**
> > **pi*
> > > * **io** **on** **the** **he ** **e c** **ch** **cha** **...*
> > > *term type ** **word** **word** **word** **word** **word** **word**
> > **word
> > > ** **word** **word** **word** **word** **word** **word** **word**
> > **word**
> > > **word** **...*
> > > *source start,end ** **0,2** **1,3** **2,4** **3,5** **4,6** **5,7**
> > **6,8
> > > ** **7,9** **8,10** **9,11** **10,12** **0,3** **1,4** **2,5** **3,6**
> **
> > > ...*
> > >
> > > WhitespaceTokenized:
> > >
> > > *term position ** **1** **2** **3** **4** **5** **6** **7** **8** **9**
> > **
> > > 10** **11** **...*
> > > *term text ** **th** **he** **the** **ch** **ha** **am** **mp** **pi**
> **
> > > io** **on** **cha** **...*
> > > *term type ** **word** **word** **word** **word** **word** **word**
> > **word
> > > ** **word** **word** **word** **word** **...*
> > > *source start,end ** **0,2** **1,3** **0,3** **0,2** **1,3** **2,4**
> > **3,5
> > > ** **4,6** **5,7** **6,8** **...*
> > >
> > > Is term position considered during scoring?
> > >
> > > Thanks,
> > > Rih
> > >
> > >
> > > On Fri, Oct 9, 2009 at 9:40 AM, Avlesh Singh <av...@gmail.com> wrote:
> > >
> > >> Use the field analysis tool to see how the data is being analyzed in
> > both
> > >> the fields.
> > >>
> > >> Cheers
> > >> Avlesh
> > >>
> > >> On Fri, Oct 9, 2009 at 12:56 AM, R. Tan <ta...@gmail.com>
> wrote:
> > >>
> > >> > Hmm... I don't quite get the desired results. Those starting with
> > "cha"
> > >> are
> > >> > now randomly ordered. Is there something wrong with the filters I
> > >> applied?
> > >> >
> > >> >
> > >> > On Thu, Oct 8, 2009 at 7:38 PM, Avlesh Singh <av...@gmail.com>
> > wrote:
> > >> >
> > >> > > Filters? I did not mean filters at all.
> > >> > > I am in a mad rush right now, but on the face of it your field
> > >> > definitions
> > >> > > look right.
> > >> > >
> > >> > > This is what I asked for -
> > >> > > q=(autoComplete2:cha^10 autoComplete:cha)
> > >> > >
> > >> > > Lemme know if this does not work for you.
> > >> > >
> > >> > > Cheers
> > >> > > Avlesh
> > >> > >
> > >> > > On Thu, Oct 8, 2009 at 4:58 PM, R. Tan <ta...@gmail.com>
> > wrote:
> > >> > >
> > >> > > > Hi Avlesh,
> > >> > > >
> > >> > > > I can't seem to get the scores right.
> > >> > > >
> > >> > > > I now have these types for the fields I'm targeting,
> > >> > > >
> > >> > > > <fieldType name="autoComplete" class="solr.TextField"
> > >> > > > positionIncrementGap="1">
> > >> > > >      <analyzer type="index">
> > >> > > >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > >> > > >        <filter class="solr.NGramFilterFactory" minGramSize="1"
> > >> > > > maxGramSize="20"/>
> > >> > > >      </analyzer>
> > >> > > >      <analyzer type="query">
> > >> > > >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > >> > > >      </analyzer>
> > >> > > >    </fieldType>
> > >> > > >    <fieldType name="autoComplete2" class="solr.TextField"
> > >> > > > positionIncrementGap="1">
> > >> > > >      <analyzer type="index">
> > >> > > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > >> > > >        <filter class="solr.NGramFilterFactory" minGramSize="1"
> > >> > > > maxGramSize="20"/>
> > >> > > >      </analyzer>
> > >> > > >      <analyzer type="query">
> > >> > > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> > >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > >> > > >      </analyzer>
> > >> > > >    </fieldType>
> > >> > > >
> > >> > > > My query is this,
> > >> > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> q=*:*&fq=autoCompleteHelper:cha+autoCompleteHelper2:cha&qf=autoCompleteHelper^10.0+autoCompleteHelper2^1.0
> > >> > > >
> > >> > > > What should I tweak from the above config and query?
> > >> > > >
> > >> > > > Thanks,
> > >> > > > Rih
> > >> > > >
> > >> > > >
> > >> > > > On Thu, Oct 8, 2009 at 4:38 PM, R. Tan <ta...@gmail.com>
> > >> wrote:
> > >> > > >
> > >> > > > > I will have to pass on this and try your suggestion first. So,
> > how
> > >> > does
> > >> > > > > your suggestion (1 and 2) boost the my startswith query? Is it
> > >> > because
> > >> > > of
> > >> > > > > the n-gram filter?
> > >> > > > >
> > >> > > > >
> > >> > > > >
> > >> > > > > On Thu, Oct 8, 2009 at 2:27 PM, Sandeep Tagore <
> > >> > > sandeep.tagore@gmail.com
> > >> > > > >wrote:
> > >> > > > >
> > >> > > > >>
> > >> > > > >> Yes it can be done but it needs some customization. Search
> for
> > >> > custom
> > >> > > > sort
> > >> > > > >> implementations/discussions.
> > >> > > > >> You can check...
> > >> > > > >>
> > >> > > > >>
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html
> > >> > > > >> .
> > >> > > > >> Let us know if you have any issues.
> > >> > > > >>
> > >> > > > >> Sandeep
> > >> > > > >>
> > >> > > > >>
> > >> > > > >> R. Tan wrote:
> > >> > > > >> >
> > >> > > > >> > This might work and I also have a single value field which
> > >> makes
> > >> > it
> > >> > > > >> > cleaner.
> > >> > > > >> > Can sort be customized (with indexOf()) from the solr
> > >> parameters
> > >> > > > alone?
> > >> > > > >> >
> > >> > > > >>
> > >> > > > >> --
> > >> > > > >> View this message in context:
> > >> > > > >>
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25799055.html
> > >> > > > >> Sent from the Solr - User mailing list archive at Nabble.com.
> > >> > > > >>
> > >> > > > >>
> > >> > > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> > >
> > >
> >
>

Re: Scoring for specific field queries

Posted by Avlesh Singh <av...@gmail.com>.
Lame question, but are you populating data in the autoCompleteHelper2 field?

Cheers
Avlesh

On Fri, Oct 9, 2009 at 12:36 PM, R. Tan <ta...@gmail.com> wrote:

> The problem is, I'm getting equal scores for this:
> Query:
> q=(autoCompleteHelper2:caf^10.0 autoCompleteHelper:caf)
>
> Partial Result:
>
> <doc>
> <float name="score">0.7821733</float>
> <str name="autoCompleteHelper">Bikes Café</str>
> </doc>
>
> <doc>
> <float name="score">0.7821733</float>
> <str name="autoCompleteHelper">Cafe Feliy</str>
> </doc>
>
> I'm using the standard request handler with this.
>
> Thanks,
> Rih
>
>
> On Fri, Oct 9, 2009 at 3:02 PM, R. Tan <ta...@gmail.com> wrote:
>
> > Avlesh,
> > I don't see anything wrong with the data from analysis.
> >
> > KeywordTokenized:
> >
> > *term position ** **1** **2** **3** **4** **5** **6** **7** **8** **9**
> **
> > 10** **11** **12** **13** **14** **15** **16** **...*
> > *term text ** **th** **he** **e ** **c** **ch** **ha** **am** **mp**
> **pi*
> > * **io** **on** **the** **he ** **e c** **ch** **cha** **...*
> > *term type ** **word** **word** **word** **word** **word** **word**
> **word
> > ** **word** **word** **word** **word** **word** **word** **word**
> **word**
> > **word** **...*
> > *source start,end ** **0,2** **1,3** **2,4** **3,5** **4,6** **5,7**
> **6,8
> > ** **7,9** **8,10** **9,11** **10,12** **0,3** **1,4** **2,5** **3,6** **
> > ...*
> >
> > WhitespaceTokenized:
> >
> > *term position ** **1** **2** **3** **4** **5** **6** **7** **8** **9**
> **
> > 10** **11** **...*
> > *term text ** **th** **he** **the** **ch** **ha** **am** **mp** **pi** **
> > io** **on** **cha** **...*
> > *term type ** **word** **word** **word** **word** **word** **word**
> **word
> > ** **word** **word** **word** **word** **...*
> > *source start,end ** **0,2** **1,3** **0,3** **0,2** **1,3** **2,4**
> **3,5
> > ** **4,6** **5,7** **6,8** **...*
> >
> > Is term position considered during scoring?
> >
> > Thanks,
> > Rih
> >
> >
> > On Fri, Oct 9, 2009 at 9:40 AM, Avlesh Singh <av...@gmail.com> wrote:
> >
> >> Use the field analysis tool to see how the data is being analyzed in
> both
> >> the fields.
> >>
> >> Cheers
> >> Avlesh
> >>
> >> On Fri, Oct 9, 2009 at 12:56 AM, R. Tan <ta...@gmail.com> wrote:
> >>
> >> > Hmm... I don't quite get the desired results. Those starting with
> "cha"
> >> are
> >> > now randomly ordered. Is there something wrong with the filters I
> >> applied?
> >> >
> >> >
> >> > On Thu, Oct 8, 2009 at 7:38 PM, Avlesh Singh <av...@gmail.com>
> wrote:
> >> >
> >> > > Filters? I did not mean filters at all.
> >> > > I am in a mad rush right now, but on the face of it your field
> >> > definitions
> >> > > look right.
> >> > >
> >> > > This is what I asked for -
> >> > > q=(autoComplete2:cha^10 autoComplete:cha)
> >> > >
> >> > > Lemme know if this does not work for you.
> >> > >
> >> > > Cheers
> >> > > Avlesh
> >> > >
> >> > > On Thu, Oct 8, 2009 at 4:58 PM, R. Tan <ta...@gmail.com>
> wrote:
> >> > >
> >> > > > Hi Avlesh,
> >> > > >
> >> > > > I can't seem to get the scores right.
> >> > > >
> >> > > > I now have these types for the fields I'm targeting,
> >> > > >
> >> > > > <fieldType name="autoComplete" class="solr.TextField"
> >> > > > positionIncrementGap="1">
> >> > > >      <analyzer type="index">
> >> > > >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> >> > > >        <filter class="solr.NGramFilterFactory" minGramSize="1"
> >> > > > maxGramSize="20"/>
> >> > > >      </analyzer>
> >> > > >      <analyzer type="query">
> >> > > >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> >> > > >      </analyzer>
> >> > > >    </fieldType>
> >> > > >    <fieldType name="autoComplete2" class="solr.TextField"
> >> > > > positionIncrementGap="1">
> >> > > >      <analyzer type="index">
> >> > > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> >> > > >        <filter class="solr.NGramFilterFactory" minGramSize="1"
> >> > > > maxGramSize="20"/>
> >> > > >      </analyzer>
> >> > > >      <analyzer type="query">
> >> > > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> >> > > >        <filter class="solr.LowerCaseFilterFactory" />
> >> > > >      </analyzer>
> >> > > >    </fieldType>
> >> > > >
> >> > > > My query is this,
> >> > > >
> >> > > >
> >> > >
> >> >
> >>
> q=*:*&fq=autoCompleteHelper:cha+autoCompleteHelper2:cha&qf=autoCompleteHelper^10.0+autoCompleteHelper2^1.0
> >> > > >
> >> > > > What should I tweak from the above config and query?
> >> > > >
> >> > > > Thanks,
> >> > > > Rih
> >> > > >
> >> > > >
> >> > > > On Thu, Oct 8, 2009 at 4:38 PM, R. Tan <ta...@gmail.com>
> >> wrote:
> >> > > >
> >> > > > > I will have to pass on this and try your suggestion first. So,
> how
> >> > does
> >> > > > > your suggestion (1 and 2) boost the my startswith query? Is it
> >> > because
> >> > > of
> >> > > > > the n-gram filter?
> >> > > > >
> >> > > > >
> >> > > > >
> >> > > > > On Thu, Oct 8, 2009 at 2:27 PM, Sandeep Tagore <
> >> > > sandeep.tagore@gmail.com
> >> > > > >wrote:
> >> > > > >
> >> > > > >>
> >> > > > >> Yes it can be done but it needs some customization. Search for
> >> > custom
> >> > > > sort
> >> > > > >> implementations/discussions.
> >> > > > >> You can check...
> >> > > > >>
> >> > > > >>
> >> > > >
> >> > >
> >> >
> >>
> http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html
> >> > > > >> .
> >> > > > >> Let us know if you have any issues.
> >> > > > >>
> >> > > > >> Sandeep
> >> > > > >>
> >> > > > >>
> >> > > > >> R. Tan wrote:
> >> > > > >> >
> >> > > > >> > This might work and I also have a single value field which
> >> makes
> >> > it
> >> > > > >> > cleaner.
> >> > > > >> > Can sort be customized (with indexOf()) from the solr
> >> parameters
> >> > > > alone?
> >> > > > >> >
> >> > > > >>
> >> > > > >> --
> >> > > > >> View this message in context:
> >> > > > >>
> >> > > >
> >> > >
> >> >
> >>
> http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25799055.html
> >> > > > >> Sent from the Solr - User mailing list archive at Nabble.com.
> >> > > > >>
> >> > > > >>
> >> > > > >
> >> > > >
> >> > >
> >> >
> >>
> >
> >
>

Re: Scoring for specific field queries

Posted by "R. Tan" <ta...@gmail.com>.
The problem is, I'm getting equal scores for this:
Query:
q=(autoCompleteHelper2:caf^10.0 autoCompleteHelper:caf)

Partial Result:

<doc>
<float name="score">0.7821733</float>
<str name="autoCompleteHelper">Bikes Café</str>
</doc>

<doc>
<float name="score">0.7821733</float>
<str name="autoCompleteHelper">Cafe Feliy</str>
</doc>

I'm using the standard request handler with this.

Thanks,
Rih


On Fri, Oct 9, 2009 at 3:02 PM, R. Tan <ta...@gmail.com> wrote:

> Avlesh,
> I don't see anything wrong with the data from analysis.
>
> KeywordTokenized:
>
> *term position ** **1** **2** **3** **4** **5** **6** **7** **8** **9** **
> 10** **11** **12** **13** **14** **15** **16** **...*
> *term text ** **th** **he** **e ** **c** **ch** **ha** **am** **mp** **pi*
> * **io** **on** **the** **he ** **e c** **ch** **cha** **...*
> *term type ** **word** **word** **word** **word** **word** **word** **word
> ** **word** **word** **word** **word** **word** **word** **word** **word**
> **word** **...*
> *source start,end ** **0,2** **1,3** **2,4** **3,5** **4,6** **5,7** **6,8
> ** **7,9** **8,10** **9,11** **10,12** **0,3** **1,4** **2,5** **3,6** **
> ...*
>
> WhitespaceTokenized:
>
> *term position ** **1** **2** **3** **4** **5** **6** **7** **8** **9** **
> 10** **11** **...*
> *term text ** **th** **he** **the** **ch** **ha** **am** **mp** **pi** **
> io** **on** **cha** **...*
> *term type ** **word** **word** **word** **word** **word** **word** **word
> ** **word** **word** **word** **word** **...*
> *source start,end ** **0,2** **1,3** **0,3** **0,2** **1,3** **2,4** **3,5
> ** **4,6** **5,7** **6,8** **...*
>
> Is term position considered during scoring?
>
> Thanks,
> Rih
>
>
> On Fri, Oct 9, 2009 at 9:40 AM, Avlesh Singh <av...@gmail.com> wrote:
>
>> Use the field analysis tool to see how the data is being analyzed in both
>> the fields.
>>
>> Cheers
>> Avlesh
>>
>> On Fri, Oct 9, 2009 at 12:56 AM, R. Tan <ta...@gmail.com> wrote:
>>
>> > Hmm... I don't quite get the desired results. Those starting with "cha"
>> are
>> > now randomly ordered. Is there something wrong with the filters I
>> applied?
>> >
>> >
>> > On Thu, Oct 8, 2009 at 7:38 PM, Avlesh Singh <av...@gmail.com> wrote:
>> >
>> > > Filters? I did not mean filters at all.
>> > > I am in a mad rush right now, but on the face of it your field
>> > definitions
>> > > look right.
>> > >
>> > > This is what I asked for -
>> > > q=(autoComplete2:cha^10 autoComplete:cha)
>> > >
>> > > Lemme know if this does not work for you.
>> > >
>> > > Cheers
>> > > Avlesh
>> > >
>> > > On Thu, Oct 8, 2009 at 4:58 PM, R. Tan <ta...@gmail.com> wrote:
>> > >
>> > > > Hi Avlesh,
>> > > >
>> > > > I can't seem to get the scores right.
>> > > >
>> > > > I now have these types for the fields I'm targeting,
>> > > >
>> > > > <fieldType name="autoComplete" class="solr.TextField"
>> > > > positionIncrementGap="1">
>> > > >      <analyzer type="index">
>> > > >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>> > > >        <filter class="solr.LowerCaseFilterFactory" />
>> > > >        <filter class="solr.NGramFilterFactory" minGramSize="1"
>> > > > maxGramSize="20"/>
>> > > >      </analyzer>
>> > > >      <analyzer type="query">
>> > > >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>> > > >        <filter class="solr.LowerCaseFilterFactory" />
>> > > >      </analyzer>
>> > > >    </fieldType>
>> > > >    <fieldType name="autoComplete2" class="solr.TextField"
>> > > > positionIncrementGap="1">
>> > > >      <analyzer type="index">
>> > > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
>> > > >        <filter class="solr.LowerCaseFilterFactory" />
>> > > >        <filter class="solr.NGramFilterFactory" minGramSize="1"
>> > > > maxGramSize="20"/>
>> > > >      </analyzer>
>> > > >      <analyzer type="query">
>> > > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
>> > > >        <filter class="solr.LowerCaseFilterFactory" />
>> > > >      </analyzer>
>> > > >    </fieldType>
>> > > >
>> > > > My query is this,
>> > > >
>> > > >
>> > >
>> >
>> q=*:*&fq=autoCompleteHelper:cha+autoCompleteHelper2:cha&qf=autoCompleteHelper^10.0+autoCompleteHelper2^1.0
>> > > >
>> > > > What should I tweak from the above config and query?
>> > > >
>> > > > Thanks,
>> > > > Rih
>> > > >
>> > > >
>> > > > On Thu, Oct 8, 2009 at 4:38 PM, R. Tan <ta...@gmail.com>
>> wrote:
>> > > >
>> > > > > I will have to pass on this and try your suggestion first. So, how
>> > does
>> > > > > your suggestion (1 and 2) boost the my startswith query? Is it
>> > because
>> > > of
>> > > > > the n-gram filter?
>> > > > >
>> > > > >
>> > > > >
>> > > > > On Thu, Oct 8, 2009 at 2:27 PM, Sandeep Tagore <
>> > > sandeep.tagore@gmail.com
>> > > > >wrote:
>> > > > >
>> > > > >>
>> > > > >> Yes it can be done but it needs some customization. Search for
>> > custom
>> > > > sort
>> > > > >> implementations/discussions.
>> > > > >> You can check...
>> > > > >>
>> > > > >>
>> > > >
>> > >
>> >
>> http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html
>> > > > >> .
>> > > > >> Let us know if you have any issues.
>> > > > >>
>> > > > >> Sandeep
>> > > > >>
>> > > > >>
>> > > > >> R. Tan wrote:
>> > > > >> >
>> > > > >> > This might work and I also have a single value field which
>> makes
>> > it
>> > > > >> > cleaner.
>> > > > >> > Can sort be customized (with indexOf()) from the solr
>> parameters
>> > > > alone?
>> > > > >> >
>> > > > >>
>> > > > >> --
>> > > > >> View this message in context:
>> > > > >>
>> > > >
>> > >
>> >
>> http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25799055.html
>> > > > >> Sent from the Solr - User mailing list archive at Nabble.com.
>> > > > >>
>> > > > >>
>> > > > >
>> > > >
>> > >
>> >
>>
>
>

Re: Scoring for specific field queries

Posted by "R. Tan" <ta...@gmail.com>.
Avlesh,
I don't see anything wrong with the data from analysis.

KeywordTokenized:

*term position ** **1** **2** **3** **4** **5** **6** **7** **8** **9** **10
** **11** **12** **13** **14** **15** **16** **...*
*term text ** **th** **he** **e ** **c** **ch** **ha** **am** **mp** **pi**
**io** **on** **the** **he ** **e c** **ch** **cha** **...*
*term type ** **word** **word** **word** **word** **word** **word** **word**
**word** **word** **word** **word** **word** **word** **word** **word** **
word** **...*
*source start,end ** **0,2** **1,3** **2,4** **3,5** **4,6** **5,7** **6,8**
**7,9** **8,10** **9,11** **10,12** **0,3** **1,4** **2,5** **3,6** **...*

WhitespaceTokenized:

*term position ** **1** **2** **3** **4** **5** **6** **7** **8** **9** **10
** **11** **...*
*term text ** **th** **he** **the** **ch** **ha** **am** **mp** **pi** **io*
* **on** **cha** **...*
*term type ** **word** **word** **word** **word** **word** **word** **word**
**word** **word** **word** **word** **...*
*source start,end ** **0,2** **1,3** **0,3** **0,2** **1,3** **2,4** **3,5**
**4,6** **5,7** **6,8** **...*

Is term position considered during scoring?

Thanks,
Rih


On Fri, Oct 9, 2009 at 9:40 AM, Avlesh Singh <av...@gmail.com> wrote:

> Use the field analysis tool to see how the data is being analyzed in both
> the fields.
>
> Cheers
> Avlesh
>
> On Fri, Oct 9, 2009 at 12:56 AM, R. Tan <ta...@gmail.com> wrote:
>
> > Hmm... I don't quite get the desired results. Those starting with "cha"
> are
> > now randomly ordered. Is there something wrong with the filters I
> applied?
> >
> >
> > On Thu, Oct 8, 2009 at 7:38 PM, Avlesh Singh <av...@gmail.com> wrote:
> >
> > > Filters? I did not mean filters at all.
> > > I am in a mad rush right now, but on the face of it your field
> > definitions
> > > look right.
> > >
> > > This is what I asked for -
> > > q=(autoComplete2:cha^10 autoComplete:cha)
> > >
> > > Lemme know if this does not work for you.
> > >
> > > Cheers
> > > Avlesh
> > >
> > > On Thu, Oct 8, 2009 at 4:58 PM, R. Tan <ta...@gmail.com> wrote:
> > >
> > > > Hi Avlesh,
> > > >
> > > > I can't seem to get the scores right.
> > > >
> > > > I now have these types for the fields I'm targeting,
> > > >
> > > > <fieldType name="autoComplete" class="solr.TextField"
> > > > positionIncrementGap="1">
> > > >      <analyzer type="index">
> > > >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > >        <filter class="solr.NGramFilterFactory" minGramSize="1"
> > > > maxGramSize="20"/>
> > > >      </analyzer>
> > > >      <analyzer type="query">
> > > >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > >      </analyzer>
> > > >    </fieldType>
> > > >    <fieldType name="autoComplete2" class="solr.TextField"
> > > > positionIncrementGap="1">
> > > >      <analyzer type="index">
> > > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > >        <filter class="solr.NGramFilterFactory" minGramSize="1"
> > > > maxGramSize="20"/>
> > > >      </analyzer>
> > > >      <analyzer type="query">
> > > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> > > >        <filter class="solr.LowerCaseFilterFactory" />
> > > >      </analyzer>
> > > >    </fieldType>
> > > >
> > > > My query is this,
> > > >
> > > >
> > >
> >
> q=*:*&fq=autoCompleteHelper:cha+autoCompleteHelper2:cha&qf=autoCompleteHelper^10.0+autoCompleteHelper2^1.0
> > > >
> > > > What should I tweak from the above config and query?
> > > >
> > > > Thanks,
> > > > Rih
> > > >
> > > >
> > > > On Thu, Oct 8, 2009 at 4:38 PM, R. Tan <ta...@gmail.com>
> wrote:
> > > >
> > > > > I will have to pass on this and try your suggestion first. So, how
> > does
> > > > > your suggestion (1 and 2) boost the my startswith query? Is it
> > because
> > > of
> > > > > the n-gram filter?
> > > > >
> > > > >
> > > > >
> > > > > On Thu, Oct 8, 2009 at 2:27 PM, Sandeep Tagore <
> > > sandeep.tagore@gmail.com
> > > > >wrote:
> > > > >
> > > > >>
> > > > >> Yes it can be done but it needs some customization. Search for
> > custom
> > > > sort
> > > > >> implementations/discussions.
> > > > >> You can check...
> > > > >>
> > > > >>
> > > >
> > >
> >
> http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html
> > > > >> .
> > > > >> Let us know if you have any issues.
> > > > >>
> > > > >> Sandeep
> > > > >>
> > > > >>
> > > > >> R. Tan wrote:
> > > > >> >
> > > > >> > This might work and I also have a single value field which makes
> > it
> > > > >> > cleaner.
> > > > >> > Can sort be customized (with indexOf()) from the solr parameters
> > > > alone?
> > > > >> >
> > > > >>
> > > > >> --
> > > > >> View this message in context:
> > > > >>
> > > >
> > >
> >
> http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25799055.html
> > > > >> Sent from the Solr - User mailing list archive at Nabble.com.
> > > > >>
> > > > >>
> > > > >
> > > >
> > >
> >
>

Re: Scoring for specific field queries

Posted by Avlesh Singh <av...@gmail.com>.
Use the field analysis tool to see how the data is being analyzed in both
the fields.

Cheers
Avlesh

On Fri, Oct 9, 2009 at 12:56 AM, R. Tan <ta...@gmail.com> wrote:

> Hmm... I don't quite get the desired results. Those starting with "cha" are
> now randomly ordered. Is there something wrong with the filters I applied?
>
>
> On Thu, Oct 8, 2009 at 7:38 PM, Avlesh Singh <av...@gmail.com> wrote:
>
> > Filters? I did not mean filters at all.
> > I am in a mad rush right now, but on the face of it your field
> definitions
> > look right.
> >
> > This is what I asked for -
> > q=(autoComplete2:cha^10 autoComplete:cha)
> >
> > Lemme know if this does not work for you.
> >
> > Cheers
> > Avlesh
> >
> > On Thu, Oct 8, 2009 at 4:58 PM, R. Tan <ta...@gmail.com> wrote:
> >
> > > Hi Avlesh,
> > >
> > > I can't seem to get the scores right.
> > >
> > > I now have these types for the fields I'm targeting,
> > >
> > > <fieldType name="autoComplete" class="solr.TextField"
> > > positionIncrementGap="1">
> > >      <analyzer type="index">
> > >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> > >        <filter class="solr.LowerCaseFilterFactory" />
> > >        <filter class="solr.NGramFilterFactory" minGramSize="1"
> > > maxGramSize="20"/>
> > >      </analyzer>
> > >      <analyzer type="query">
> > >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> > >        <filter class="solr.LowerCaseFilterFactory" />
> > >      </analyzer>
> > >    </fieldType>
> > >    <fieldType name="autoComplete2" class="solr.TextField"
> > > positionIncrementGap="1">
> > >      <analyzer type="index">
> > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> > >        <filter class="solr.LowerCaseFilterFactory" />
> > >        <filter class="solr.NGramFilterFactory" minGramSize="1"
> > > maxGramSize="20"/>
> > >      </analyzer>
> > >      <analyzer type="query">
> > >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> > >        <filter class="solr.LowerCaseFilterFactory" />
> > >      </analyzer>
> > >    </fieldType>
> > >
> > > My query is this,
> > >
> > >
> >
> q=*:*&fq=autoCompleteHelper:cha+autoCompleteHelper2:cha&qf=autoCompleteHelper^10.0+autoCompleteHelper2^1.0
> > >
> > > What should I tweak from the above config and query?
> > >
> > > Thanks,
> > > Rih
> > >
> > >
> > > On Thu, Oct 8, 2009 at 4:38 PM, R. Tan <ta...@gmail.com> wrote:
> > >
> > > > I will have to pass on this and try your suggestion first. So, how
> does
> > > > your suggestion (1 and 2) boost the my startswith query? Is it
> because
> > of
> > > > the n-gram filter?
> > > >
> > > >
> > > >
> > > > On Thu, Oct 8, 2009 at 2:27 PM, Sandeep Tagore <
> > sandeep.tagore@gmail.com
> > > >wrote:
> > > >
> > > >>
> > > >> Yes it can be done but it needs some customization. Search for
> custom
> > > sort
> > > >> implementations/discussions.
> > > >> You can check...
> > > >>
> > > >>
> > >
> >
> http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html
> > > >> .
> > > >> Let us know if you have any issues.
> > > >>
> > > >> Sandeep
> > > >>
> > > >>
> > > >> R. Tan wrote:
> > > >> >
> > > >> > This might work and I also have a single value field which makes
> it
> > > >> > cleaner.
> > > >> > Can sort be customized (with indexOf()) from the solr parameters
> > > alone?
> > > >> >
> > > >>
> > > >> --
> > > >> View this message in context:
> > > >>
> > >
> >
> http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25799055.html
> > > >> Sent from the Solr - User mailing list archive at Nabble.com.
> > > >>
> > > >>
> > > >
> > >
> >
>

Re: Scoring for specific field queries

Posted by "R. Tan" <ta...@gmail.com>.
Hmm... I don't quite get the desired results. Those starting with "cha" are
now randomly ordered. Is there something wrong with the filters I applied?


On Thu, Oct 8, 2009 at 7:38 PM, Avlesh Singh <av...@gmail.com> wrote:

> Filters? I did not mean filters at all.
> I am in a mad rush right now, but on the face of it your field definitions
> look right.
>
> This is what I asked for -
> q=(autoComplete2:cha^10 autoComplete:cha)
>
> Lemme know if this does not work for you.
>
> Cheers
> Avlesh
>
> On Thu, Oct 8, 2009 at 4:58 PM, R. Tan <ta...@gmail.com> wrote:
>
> > Hi Avlesh,
> >
> > I can't seem to get the scores right.
> >
> > I now have these types for the fields I'm targeting,
> >
> > <fieldType name="autoComplete" class="solr.TextField"
> > positionIncrementGap="1">
> >      <analyzer type="index">
> >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> >        <filter class="solr.LowerCaseFilterFactory" />
> >        <filter class="solr.NGramFilterFactory" minGramSize="1"
> > maxGramSize="20"/>
> >      </analyzer>
> >      <analyzer type="query">
> >        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> >        <filter class="solr.LowerCaseFilterFactory" />
> >      </analyzer>
> >    </fieldType>
> >    <fieldType name="autoComplete2" class="solr.TextField"
> > positionIncrementGap="1">
> >      <analyzer type="index">
> >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> >        <filter class="solr.LowerCaseFilterFactory" />
> >        <filter class="solr.NGramFilterFactory" minGramSize="1"
> > maxGramSize="20"/>
> >      </analyzer>
> >      <analyzer type="query">
> >        <tokenizer class="solr.KeywordTokenizerFactory"/>
> >        <filter class="solr.LowerCaseFilterFactory" />
> >      </analyzer>
> >    </fieldType>
> >
> > My query is this,
> >
> >
> q=*:*&fq=autoCompleteHelper:cha+autoCompleteHelper2:cha&qf=autoCompleteHelper^10.0+autoCompleteHelper2^1.0
> >
> > What should I tweak from the above config and query?
> >
> > Thanks,
> > Rih
> >
> >
> > On Thu, Oct 8, 2009 at 4:38 PM, R. Tan <ta...@gmail.com> wrote:
> >
> > > I will have to pass on this and try your suggestion first. So, how does
> > > your suggestion (1 and 2) boost the my startswith query? Is it because
> of
> > > the n-gram filter?
> > >
> > >
> > >
> > > On Thu, Oct 8, 2009 at 2:27 PM, Sandeep Tagore <
> sandeep.tagore@gmail.com
> > >wrote:
> > >
> > >>
> > >> Yes it can be done but it needs some customization. Search for custom
> > sort
> > >> implementations/discussions.
> > >> You can check...
> > >>
> > >>
> >
> http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html
> > >> .
> > >> Let us know if you have any issues.
> > >>
> > >> Sandeep
> > >>
> > >>
> > >> R. Tan wrote:
> > >> >
> > >> > This might work and I also have a single value field which makes it
> > >> > cleaner.
> > >> > Can sort be customized (with indexOf()) from the solr parameters
> > alone?
> > >> >
> > >>
> > >> --
> > >> View this message in context:
> > >>
> >
> http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25799055.html
> > >> Sent from the Solr - User mailing list archive at Nabble.com.
> > >>
> > >>
> > >
> >
>

Re: Scoring for specific field queries

Posted by Avlesh Singh <av...@gmail.com>.
Filters? I did not mean filters at all.
I am in a mad rush right now, but on the face of it your field definitions
look right.

This is what I asked for -
q=(autoComplete2:cha^10 autoComplete:cha)

Lemme know if this does not work for you.

Cheers
Avlesh

On Thu, Oct 8, 2009 at 4:58 PM, R. Tan <ta...@gmail.com> wrote:

> Hi Avlesh,
>
> I can't seem to get the scores right.
>
> I now have these types for the fields I'm targeting,
>
> <fieldType name="autoComplete" class="solr.TextField"
> positionIncrementGap="1">
>      <analyzer type="index">
>        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>        <filter class="solr.LowerCaseFilterFactory" />
>        <filter class="solr.NGramFilterFactory" minGramSize="1"
> maxGramSize="20"/>
>      </analyzer>
>      <analyzer type="query">
>        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>        <filter class="solr.LowerCaseFilterFactory" />
>      </analyzer>
>    </fieldType>
>    <fieldType name="autoComplete2" class="solr.TextField"
> positionIncrementGap="1">
>      <analyzer type="index">
>        <tokenizer class="solr.KeywordTokenizerFactory"/>
>        <filter class="solr.LowerCaseFilterFactory" />
>        <filter class="solr.NGramFilterFactory" minGramSize="1"
> maxGramSize="20"/>
>      </analyzer>
>      <analyzer type="query">
>        <tokenizer class="solr.KeywordTokenizerFactory"/>
>        <filter class="solr.LowerCaseFilterFactory" />
>      </analyzer>
>    </fieldType>
>
> My query is this,
>
> q=*:*&fq=autoCompleteHelper:cha+autoCompleteHelper2:cha&qf=autoCompleteHelper^10.0+autoCompleteHelper2^1.0
>
> What should I tweak from the above config and query?
>
> Thanks,
> Rih
>
>
> On Thu, Oct 8, 2009 at 4:38 PM, R. Tan <ta...@gmail.com> wrote:
>
> > I will have to pass on this and try your suggestion first. So, how does
> > your suggestion (1 and 2) boost the my startswith query? Is it because of
> > the n-gram filter?
> >
> >
> >
> > On Thu, Oct 8, 2009 at 2:27 PM, Sandeep Tagore <sandeep.tagore@gmail.com
> >wrote:
> >
> >>
> >> Yes it can be done but it needs some customization. Search for custom
> sort
> >> implementations/discussions.
> >> You can check...
> >>
> >>
> http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html
> >> .
> >> Let us know if you have any issues.
> >>
> >> Sandeep
> >>
> >>
> >> R. Tan wrote:
> >> >
> >> > This might work and I also have a single value field which makes it
> >> > cleaner.
> >> > Can sort be customized (with indexOf()) from the solr parameters
> alone?
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25799055.html
> >> Sent from the Solr - User mailing list archive at Nabble.com.
> >>
> >>
> >
>

Re: Scoring for specific field queries

Posted by "R. Tan" <ta...@gmail.com>.
Hi Avlesh,

I can't seem to get the scores right.

I now have these types for the fields I'm targeting,

<fieldType name="autoComplete" class="solr.TextField"
positionIncrementGap="1">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory" />
        <filter class="solr.NGramFilterFactory" minGramSize="1"
maxGramSize="20"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory" />
      </analyzer>
    </fieldType>
    <fieldType name="autoComplete2" class="solr.TextField"
positionIncrementGap="1">
      <analyzer type="index">
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory" />
        <filter class="solr.NGramFilterFactory" minGramSize="1"
maxGramSize="20"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory" />
      </analyzer>
    </fieldType>

My query is this,
q=*:*&fq=autoCompleteHelper:cha+autoCompleteHelper2:cha&qf=autoCompleteHelper^10.0+autoCompleteHelper2^1.0

What should I tweak from the above config and query?

Thanks,
Rih


On Thu, Oct 8, 2009 at 4:38 PM, R. Tan <ta...@gmail.com> wrote:

> I will have to pass on this and try your suggestion first. So, how does
> your suggestion (1 and 2) boost the my startswith query? Is it because of
> the n-gram filter?
>
>
>
> On Thu, Oct 8, 2009 at 2:27 PM, Sandeep Tagore <sa...@gmail.com>wrote:
>
>>
>> Yes it can be done but it needs some customization. Search for custom sort
>> implementations/discussions.
>> You can check...
>>
>> http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html
>> .
>> Let us know if you have any issues.
>>
>> Sandeep
>>
>>
>> R. Tan wrote:
>> >
>> > This might work and I also have a single value field which makes it
>> > cleaner.
>> > Can sort be customized (with indexOf()) from the solr parameters alone?
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25799055.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>>
>

Re: Scoring for specific field queries

Posted by "R. Tan" <ta...@gmail.com>.
I will have to pass on this and try your suggestion first. So, how does your
suggestion (1 and 2) boost the my startswith query? Is it because of the
n-gram filter?


On Thu, Oct 8, 2009 at 2:27 PM, Sandeep Tagore <sa...@gmail.com>wrote:

>
> Yes it can be done but it needs some customization. Search for custom sort
> implementations/discussions.
> You can check...
>
> http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html
> .
> Let us know if you have any issues.
>
> Sandeep
>
>
> R. Tan wrote:
> >
> > This might work and I also have a single value field which makes it
> > cleaner.
> > Can sort be customized (with indexOf()) from the solr parameters alone?
> >
>
> --
> View this message in context:
> http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25799055.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>

Re: Scoring for specific field queries

Posted by Sandeep Tagore <sa...@gmail.com>.
Yes it can be done but it needs some customization. Search for custom sort
implementations/discussions.
You can check...
http://lucene.apache.org/solr/api/org/apache/solr/schema/RandomSortField.html.
Let us know if you have any issues.

Sandeep


R. Tan wrote:
> 
> This might work and I also have a single value field which makes it
> cleaner.
> Can sort be customized (with indexOf()) from the solr parameters alone?
> 

-- 
View this message in context: http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25799055.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Scoring for specific field queries

Posted by "R. Tan" <ta...@gmail.com>.
This might work and I also have a single value field which makes it cleaner.
Can sort be customized (with indexOf()) from the solr parameters alone?

Thanks!


On Thu, Oct 8, 2009 at 1:40 PM, Sandeep Tagore <sa...@gmail.com>wrote:

>
> Hi Rihaed,
> I guess we don't need to depend on scores all the times.
> You can use custom sort to sort the results. Take a dynamicField, fill it
> with indexOf(keyword) value, sort the results by the field in ascending
> order. Then the records which contain the keyword at the earlier position
> will come first.
>
> Regards,
> Sandeep
>
>
> R. Tan wrote:
> >
> > Hi,
> > How can I get wildcard search (e.g. cha*) to score documents based on the
> > position of the keyword in a field? Closer (to the start) means higher
> > score.
> >
>
> --
> View this message in context:
> http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25798657.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>

Re: Scoring for specific field queries

Posted by Sandeep Tagore <sa...@gmail.com>.
Hi Avlesh,
Thanks for your attention to my post. 

   1. If the word "computer" occurs in multiple times in a document what
   would you do in that case? Is this dynamic field supposed to be
multivalued?
   I can't even imagine what would you do if the word "computer" occurs in
   multiple documents multiple times?
   => It doesn't matter how many times a word occurs in that document.
Consider its first occurrence and use it for sorting. The dynamic field
should not be multivalued. If the keyword occurs at the same position in
multiple documents then the document which is inserted first will come
first.
   2. Multivalued fields cannot be sorted upon.
   => Yes.. I agree.
   3. One needs to know the unique number of such keywords before
   implementing because you'll potentially end up creating those many
fields.
   => I didn't get this. Why one should know the unique number of keywords
before implementation. If we have the logic, it works for all the keywords.
Most of the people do the same in case of geographical sorting. They
calculate the distance and sort it before displaying it. They don't need to
worry about the distance which user requests for.

Please tell me your thoughts and correct me if I am wrong.

Thanks,
Sandeep
-- 
View this message in context: http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25798925.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Scoring for specific field queries

Posted by Avlesh Singh <av...@gmail.com>.
>
> I guess we don't need to depend on scores all the times.
> You can use custom sort to sort the results. Take a dynamicField, fill it
> with indexOf(keyword) value, sort the results by the field in ascending
> order. Then the records which contain the keyword at the earlier position
> will come first.
>
Warning: This is a bad idea for multiple reasons:

   1. If the word "computer" occurs in multiple times in a document what
   would you do in that case? Is this dynamic field supposed to be multivalued?
   I can't even imagine what would you do if the word "computer" occurs in
   multiple documents multiple times?
   2. Multivalued fields cannot be sorted upon.
   3. One needs to know the unique number of such keywords before
   implementing because you'll potentially end up creating those many fields.

Cheers
Avlesh

On Thu, Oct 8, 2009 at 11:10 AM, Sandeep Tagore <sa...@gmail.com>wrote:

>
> Hi Rihaed,
> I guess we don't need to depend on scores all the times.
> You can use custom sort to sort the results. Take a dynamicField, fill it
> with indexOf(keyword) value, sort the results by the field in ascending
> order. Then the records which contain the keyword at the earlier position
> will come first.
>
> Regards,
> Sandeep
>
>
> R. Tan wrote:
> >
> > Hi,
> > How can I get wildcard search (e.g. cha*) to score documents based on the
> > position of the keyword in a field? Closer (to the start) means higher
> > score.
> >
>
> --
> View this message in context:
> http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25798657.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>

Re: Scoring for specific field queries

Posted by Sandeep Tagore <sa...@gmail.com>.
Hi Rihaed,
I guess we don't need to depend on scores all the times.
You can use custom sort to sort the results. Take a dynamicField, fill it
with indexOf(keyword) value, sort the results by the field in ascending
order. Then the records which contain the keyword at the earlier position
will come first.

Regards,
Sandeep


R. Tan wrote:
> 
> Hi,
> How can I get wildcard search (e.g. cha*) to score documents based on the
> position of the keyword in a field? Closer (to the start) means higher
> score.
> 

-- 
View this message in context: http://www.nabble.com/Scoring-for-specific-field-queries-tp25798390p25798657.html
Sent from the Solr - User mailing list archive at Nabble.com.