Sandeep, I do get results when I search for "get what you", not 0 results.

What in my schema makes this difference?

    <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <!-- in this example, we will only use synonyms at query time
        <filter class="solr.SynonymFilterFactory"
synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
        -->
        <!-- Case insensitive stop word removal.
             enablePositionIncrements=true ensures that a 'gap' is left to
             allow for accurate phrase queries.
        -->
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="stopwords.txt"
                enablePositionIncrements="true"
                />
        <filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" generateNumberParts="1" catenateWords="1"
catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
<!--        <filter class="solr.EnglishPorterFilterFactory"
protected="protwords.txt"/> -->
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory"
synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<!--        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt"/> -->
        <filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" generateNumberParts="1" catenateWords="0"
catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
        <filter class="solr.LowerCaseFilterFactory"/>
<!--        <filter class="solr.EnglishPorterFilterFactory"
protected="protwords.txt"/> -->
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
    </fieldType>

I need to learn Solrj. I am currently using javascript as a client and
invoke http calls to get results to display in the browser. Can Solrj
get all the results at one short w/o the http call? I need to do some
postprocessing against all the results and then display the processed
data. Submitting multiple http queries and post-process after each
query does not seem to be the right way.

Thanks.

Elaine

On Wed, Oct 7, 2009 at 11:06 AM, Sandeep Tagore
<sandeep.tag...@gmail.com> wrote:
>
> Hi Elaine,
> You can achieve that with some modifications in sol configuration files.
> Generally text will be configured as
> <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
>      <analyzer type="index">
>        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>        <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt" enablePositionIncrements="true"/>
>        <filter class="solr.LowerCaseFilterFactory"/>
>      </analyzer>
>      <analyzer type="query">
>        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>        <filter class="solr.StopFilterFactory" ignoreCase="true"
> words="stopwords.txt"/>
>        <filter class="solr.LowerCaseFilterFactory"/>
>      </analyzer>
>    </fieldType>
>
> When a field is declared as text(with above conf.) it will tokenized. Say,
> for example, your sentence
> "Can you get what you want?" will become be tokenized like "can, you, get,
> what, you, want". So when you search for 'sentence:"get what you"' you will
> get 0 results.
>
> To achieve your objective you can remove Tokenizers in "text" configuration.
> The best way I suggest is to declare the field as type "string". Search the
> string with wild card like 'sentence:"*get what you*"' using sorlj client
> and when you get try to records (results) save the output of
> sentence.indexOf(keyword) in your java bean. Here sentence is a variable
> declared in the java bean.
> For more details you need to read the usage of Solrj. If you have any issues
> in modifying the configuration post the configuration you have for the
> fieldtype "text" and i will modify it for you.
>
> Regards,
> Sandeep Team
>
>
> Elaine Li wrote:
>>
>> Say the field <field name="sentence">Can you get what you
>> want?</field>, the field type is Text.
>>
>> My query contains 'sentence:"get what you"'. Is it possible to get
>> number 2 directly from a query since the word 'get' is the 2nd token
>> in the sentence?
>>
>
> --
> View this message in context: 
> http://www.nabble.com/How-to-retrieve-the-index-of-a-string-within-a-field--tp25771821p25788406.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>

Reply via email to