Yes, that's a common strategy, and it's also fairly common to index two (or
more) versions of the field, with different tokenizations (or not
tokenized) if there is a need to perform different types of search the
field. This duplication can be acheived either with <copyField> in the
schema, CloneFieldUpdateRequestProcessor
<https://lucene.apache.org/solr/7_4_0//solr-core/org/apache/solr/update/processor/CloneFieldUpdateProcessorFactory.html>
in a custom update chain, or in the indexing/ETL software prior to sending
the data to solr depending on what you have available and what you need to
do.

-Gus

On Wed, Aug 15, 2018 at 7:12 PM, Hanjan, Harinder <
harinder.han...@calgary.ca> wrote:

> Keeping the field as string so that no analysis is done on it has yielded
> promising results.
>
> <field name="suggestion" type="string" stored="true" indexed="true"
> required="true" />
>
> I will test more tomorrow and report back.
>
> -----Original Message-----
> From: Hanjan, Harinder [mailto:harinder.han...@calgary.ca]
> Sent: Wednesday, August 15, 2018 5:01 PM
> To: solr-user@lucene.apache.org
> Subject: [EXT] Type ahead functionality using complex phrase query parser
>
> Hello!
>
> I can't get Solr to give the results I would expect, would appreciate if
> someone could point me in the right direction here.
>
> /select?q={!complexphrase}"gar*"
> shows me the following terms
>
> -        garages
>
> -        garburator
>
> -        gardening
>
> -        gardens
>
> -        garage
>
> -        garden
>
> -        garbage
>
> -        century gardens
>
> -        community gardens
>
> I was not expecting to see the bottom two.
>
> --- schema.xml ---
> <field name="suggestion" type="text_wildcard" stored="true" indexed="true"
> required="true" /> <fieldType name="text_wildcard" class="solr.TextField"
> positionIncrementGap="100"> <analyzer type="index">
>                               <tokenizer class="solr.
> StandardTokenizerFactory"/>
>                               <filter class="solr.
> LowerCaseFilterFactory"/>
>                </analyzer>
> </fieldType>
>
> --- query ---
> /select?q={!complexphrase}"gar*"
>
> --- solrconfig.xml ---
> <requestHandler name="/select" class="solr.SearchHandler">
>                <lst name="defaults">
>                               <str name="echoParams">explicit</str>
>                               <int name="rows">10</int>
>                               <str name="df">suggestion</str>
>                </lst>
> </requestHandler>
>
> Thanks!
> Harinder
>
> ________________________________
> NOTICE -
> This communication is intended ONLY for the use of the person or entity
> named above and may contain information that is confidential or legally
> privileged. If you are not the intended recipient named above or a person
> responsible for delivering messages or communications to the intended
> recipient, YOU ARE HEREBY NOTIFIED that any use, distribution, or copying
> of this communication or any of the information contained in it is strictly
> prohibited. If you have received this communication in error, please notify
> us immediately by telephone and then destroy or delete this communication,
> or return it to us by mail if requested by us. The City of Calgary thanks
> you for your attention and co-operation.
>



-- 
http://www.the111shift.com

Reply via email to