On Apr 25, 2008, at 3:02 AM, Rantjil Bould wrote:
Nice. Great help. I have added following fields to hold tokens.

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

   <fieldType name="prefix_token" 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>

<field name="prefix1" type="prefix_full" indexed="true" stored="true"/> <field name="prefix2" type="prefix_token" indexed="true" stored="true"/>

  <copyField source="content" dest="prefix1"/>
  <copyField source="content" dest="prefix2"/>
I am wondering how can I extract tokens? I can see all tokens
http://localhost:8080/solr/admin/schema.jsp page for fields prefix1 and
prefix2 but when I query
http://localhost:8080/solr/select?fl=prefix1,id&q=prefix2:jun%20prefix2:jun to get the content for prefix2, it does not display any content for prefix2.
Am I doing anything wrong???


what do you mean "extract tokens"?

The documents returned from /select? are the stored field values not the tokens -- you don't get to see the analyzed tokens (nor do you need to). If you want to interact with tokens consider using faceting.

ryan


- RB


On 4/24/08, Ryan McKinley <[EMAIL PROTECTED]> wrote:


On Apr 24, 2008, at 12:25 PM, Rantjil Bould wrote:

Hi Group,
I was asked in my project to implement google suggest kind of
functionality for searching help system. I have seen one thread
http://www.mail-archive.com/solr-user@lucene.apache.org/ msg06739.html
which
deals with the way to index if large index. But I am not able to get much information to start with. I am using JQuery's plugin for auto- suggest and query field is a large text(appx 2000 char long). I am just wondering how can I extract all tokens for any character typed by user? Somebody might have already implemented the same functionality and I would appreciate
your
help on this, even a hint might be a great help.


I don't think there is a magic one-size-fits-all solution to this, only a
set of approaches you will need to modify for your specific index.

You will need to modify the jquery plugin to grab results from a solr
query.  For starters that can be just a standard query whatever.

Unless your index is small, you will likely need to configure your index
with special fields to use for the auto-complete search.  This is the
approach pointed to in SOLR-357. Eseentially you index: "Bould" as "b" "bo"
"bou" boul" bould".

ryan



Reply via email to