The prefix query work fine with EdgeNGramFilterFactory, but I'm still not sure how to get the sorting to work.

I'm using:

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

If you have any ideas on the sorting, let me know!



Matthew Runo wrote:
Hello! Were you able to find out anything? I'd be interested to know what you found out.

+--------------------------------------------------------+
 | Matthew Runo
 | Zappos Development
 | [EMAIL PROTECTED]
 | 702-943-7833
+--------------------------------------------------------+


On Sep 15, 2007, at 11:48 PM, Ryan McKinley wrote:

Hello-

I'm building an interface where I need to display matching options as a user types into a search box. Something like google suggest, but it needs to be a little more flexible in its matches.

It first glance, I thought I just needed to write a filter that chunks each token into a set of prefixes. Check SOLR-357 -- As Hoss points out, I may just be able to use the EdgeNGramFilterFactory.

I have the basics working, but need some help getting the details to behave properly.

Consider the strings:
 Canon PowerShot
 iPod Cable
 Canon EX PIXMA
 Video Card

If I query for 'ca' I expect to get all these back. This works fine, but I need help with is ordering.

How can I boost words where the whole value (not just the token) is closer to the front of the value? That is, I want 'ca' to return:
 1. Canon PowerShot
 2. Canon EX PIXMA
 3. iPod Cable
 4. Video Card
(actually 1&2 could be swapped)

After that works, how do I boost tokens that are closer together? If I search for 'canon p', how can I make sure the results are returned as:
 1. Canon PowerShot
 2. Canon EX PIXMA


thanks
ryan








Reply via email to