Tom:

I wonder if you could do something with payloads here. Index all terms with
payloads of 10, but synonyms with 1?

Random thought off the top of my head.

Erick


On Mon, Mar 4, 2013 at 6:25 PM, Tom Burton-West <[email protected]> wrote:

> Hi Jack,
>
> Sorry the example is not clear.  Below is the normal way to accomplish
> what I am trying to do using a copyField and two separate fieldTypes with
> the index analyzer the same but the query time analyzer different.
>
> So the query would be something like q=plain:foobar^10 OR syn:foobar^1  to
> get synonyms but scored much lower than an exact match.
>
> The problem with this is since the analysis chain used for indexing is the
> same in both cases, I would rather not have to actually index the exact
> same content in the exact same way twice.
>
> Does that make it any clearer or do I need a more compelling use case?
>
> Tom
>
> <fieldType name="plain">
>     <analyzer type=index>
>    <tokenizer class="solr.StandardTokenizerFactory"/>
>   <filter class="solr.LowerCaseFilterFactory"/>
> </analyzer>
> <fieldType name="plain">
>     <analyzer type=query>
>    <tokenizer class="solr.StandardTokenizerFactory"/>
>   <filter class="solr.LowerCaseFilterFactory"/>
> </analyzer>
>
> <fieldType name="syn">
>     <analyzer type=index>
>    <tokenizer class="solr.StandardTokenizerFactory"/>
>   <filter class="solr.LowerCaseFilterFactory"/>
> </analyzer>
> <fieldType name="plain">
>     <analyzer type=query>
>    <tokenizer class="solr.StandardTokenizerFactory"/>
>    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
> ignoreCase="true" expand="true"/>
>   <filter class="solr.LowerCaseFilterFactory"/>
> </analyzer>
> <copyField source="plain" dest="syn"/>
>
> On Mon, Mar 4, 2013 at 4:43 PM, Jack Krupansky <[email protected]>wrote:
>
>>   Please clarify, and try providing a couple more use cases. I mean, the
>> case you provided suggests that the contents of the index will be different
>> between the two fields, while you told us that you wanted to share the same
>> indexed field. In other words, it sounds like you will have two copies of
>> similar data anyway.
>>
>> Maybe you simply want one copy of the stored value for the field and then
>> have one or more copyfields that index the same source data differently,
>> but don’t re-store the copied source data.
>>
>> -- Jack Krupansky
>>
>>  *From:* Tom Burton-West <[email protected]>
>> *Sent:* Monday, March 04, 2013 3:57 PM
>> *To:* [email protected]
>> *Subject:* Ability to specify 2 different query analyzers for same
>> indexed field in Solr
>>
>> Hello,
>>
>> We would like to be able to specify two different fields that both use
>> the same indexed field but use different analyzers.   An example use-case
>> for this might be doing query-time synonym expansion with the synonyms
>> weighted lower than an exact match.
>>
>> q=exact_field^10 OR synonyms^1
>>
>> The normal way to do this in Solr, which is just to set up separate
>> analyzer chains and use a copyfield, will not work for us because the field
>> in question is huge.  It is about 7 TB of OCR.
>>
>> Is there a way to do this currently in Solr?   If not ,
>>
>> 1) should I open a JIRA issue?
>> 2) can someone point me towards the part of the code I might need to
>> modify?
>>
>> Tom
>>
>>  Tom Burton-West
>> Information Retrieval Programmer
>> Digital Library Production Service
>> University of Michigan Library
>> http://www.hathitrust.org/blogs/large-scale-search
>>
>>
>>
>
>

Reply via email to