lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@frameweld.com
Subject Re: Help with highlighting
Date Wed, 23 Jun 2010 19:02:07 GMT
Thanks, that's exactly the problem. I've tried different types, even a fieldType that had no
tokenizers and that didn't work. However, text just gives me my results as wanted. 

-----Original Message-----
From: "dan sutton" <danbsutton@gmail.com>
Sent: Wednesday, June 23, 2010 12:06pm
To: solr-user@lucene.apache.org
Subject: Re: Help with highlighting

It looks to me like a tokenisation issue, all_text content and the query
text will match, but the string fieldtype fields 'might not' and therefore
will not be highlighted.

On Wed, Jun 23, 2010 at 4:40 PM, <noel@frameweld.com> wrote:

> Here's my request:
> q=ASA+AND+minisite_id%3A36&version=1.3&json.nl
> =map&rows=10&start=0&wt=json&hl=true&hl.fl=%2A&hl.simple.pre=%3Cspan+class%3D%22hl%22%3E&hl.simple.post=%3C%2Fspan%3E&hl.fragsize=0&hl.mergeContiguous=false
>
> And here's what happened:
> It didn't return results, even when I applied an asterisk for which fields
> highlight. I tried other fields and that didn't work either, however
> all_text is the only one that works. Any other ideas why the other fields
> won't highlight? Thanks.
>
> -----Original Message-----
> From: "Erik Hatcher" <erik.hatcher@gmail.com>
> Sent: Tuesday, June 22, 2010 9:49pm
> To: solr-user@lucene.apache.org
> Subject: Re: Help with highlighting
>
> You need to share with us the Solr request you made, any any custom
> request handler settings that might map to.  Chances are you just need
> to twiddle with the highlighter parameters (see wiki for docs) to get
> it to do what you want.
>
>        Erik
>
> On Jun 22, 2010, at 4:42 PM, noel@frameweld.com wrote:
>
> > Hi, I need help with highlighting fields that would match a query.
> > So far, my results only highlight if the field is from all_text, and
> > I would like it to use other fields. It simply isn't the case if I
> > just turn highlighting on. Any ideas why it only applies to
> > all_text? Here is my schema:
> >
> > <?xml version="1.0" ?>
> >
> > <schema name="Search" version="1.1">
> >       <types>
> >               <!-- Basic Solr Bundled Data Types -->
> >
> >               <!-- Rudimentary types -->
> >               <fieldType name="string" class="solr.StrField"
> > sortMissingLast="true" omitNorms="true" />
> >               <fieldType name="boolean" class="solr.BoolField"
> > sortMissingLast="true" omitNorms="true" />
> >
> >               <!-- Non-sortable numeric types -->
> >               <fieldType name="integer" class="solr.IntField"
> omitNorms="true"/>
> >
> >               <fieldType name="long" class="solr.LongField"
> omitNorms="true"/>
> >               <fieldType name="float" class="solr.FloatField"
> omitNorms="true"/>
> >               <fieldType name="double" class="solr.DoubleField"
> omitNorms="true"/>
> >
> >               <!-- Sortable numeric types -->
> >               <fieldType name="sint" class="solr.SortableIntField"
> > sortMissingLast="true" omitNorms="true"/>
> >               <fieldType name="slong" class="solr.SortableLongField"
> > sortMissingLast="true" omitNorms="true"/>
> >               <fieldType name="sfloat" class="solr.SortableFloatField"
> > sortMissingLast="true" omitNorms="true"/>
> >               <fieldType name="sdouble" class="solr.SortableDoubleField"
> > sortMissingLast="true" omitNorms="true"/>
> >
> >               <!-- Date/Time types -->
> >
> >               <fieldType name="date" class="solr.DateField"
> > sortMissingLast="true" omitNorms="true"/>
> >
> >               <!-- Pseudo types -->
> >               <fieldType name="random" class="solr.RandomSortField"
> > indexed="true" />
> >
> >               <!-- Analyzing types -->
> >               <fieldType name="text_ws" class="solr.TextField"
> > positionIncrementGap="100">
> >                       <analyzer>
> >                               <tokenizer
> class="solr.WhitespaceTokenizerFactory"/>
> >                       </analyzer>
> >               </fieldType>
> >
> >
> >               <fieldType name="text" class="solr.TextField"
> > positionIncrementGap="100">
> >                       <analyzer type="index">
> >                               <tokenizer
> class="solr.WhitespaceTokenizerFactory"/>
> >                       <!-- <filter class="solr.SynonymFilterFactory"
> > synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/> -->
> >                               <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.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>
> >
> >
> >               <fieldType name="textTight" class="solr.TextField"
> > positionIncrementGap="100" >
> >                       <analyzer>
> >                               <tokenizer
> class="solr.WhitespaceTokenizerFactory"/>
> >                               <filter class="solr.SynonymFilterFactory"
> > synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
> >                               <filter class="solr.StopFilterFactory"
> ignoreCase="true"
> > words="stopwords.txt"/>
> >                               <filter
> class="solr.WordDelimiterFilterFactory"
> > generateWordParts="0" generateNumberParts="0" catenateWords="1"
> > catenateNumbers="1" catenateAll="0"/>
> >                               <filter
> class="solr.LowerCaseFilterFactory"/>
> >                               <filter
> class="solr.EnglishPorterFilterFactory"
> > protected="protwords.txt"/>
> >                               <filter
> class="solr.RemoveDuplicatesTokenFilterFactory"/>
> >
> >                       </analyzer>
> >               </fieldType>
> >
> >               <fieldType name="textSpell" class="solr.TextField"
> > positionIncrementGap="100" >
> >                       <analyzer>
> >                               <tokenizer
> class="solr.StandardTokenizerFactory"/>
> >                               <filter
> class="solr.LowerCaseFilterFactory"/>
> >                               <filter
> class="solr.RemoveDuplicatesTokenFilterFactory" />
> >                               <filter class="solr.ShingleFilterFactory"
> maxShingleSize="2"
> > outputUnigrams="false" />
> >                       </analyzer>
> >
> >               </fieldType>
> >
> >               <fieldType name="alphaOnlySort" class="solr.TextField"
> > sortMissingLast="true" omitNorms="true">
> >                       <analyzer>
> >                               <tokenizer
> class="solr.KeywordTokenizerFactory"/>
> >                               <filter class="solr.LowerCaseFilterFactory"
> />
> >                               <filter class="solr.TrimFilterFactory" />
> >                               <filter
> class="solr.PatternReplaceFilterFactory"
> >                                       pattern="([^a-z])" replacement=""
> replace="all"
> >                               />
> >               </analyzer>
> >               </fieldType>
> >
> >               <fieldtype name="ignored" stored="false" indexed="false"
> > class="solr.StrField" />
> >
> >       </types>
> >
> >       <fields>
> > <!-- Entry details, will be used later as a unique field -->
> >               <!-- searchable things -->
> >               <field name="presentation_id" type="sint" indexed="true"
> > stored="true" />
> >               <field name="asset_id" type="sint" indexed="true"
> stored="true" />
> >               <field name="type" type="string" indexed="true"
> stored="true" />
> >               <field name="text" type="string" indexed="true"
> stored="true"
> > multiValued="true" />
> >
> >               <field name="time_code" type="string" indexed="true"
> > stored="true" />
> >               <field name="unique_key" type="string" indexed="true"
> > stored="true" />
> >               <!-- everything -->
> >
> >               <dynamicField name="*" type="text" indexed="true"
> stored="true" />
> >
> >               <field name="all_text" type="text" indexed="true"
> stored="true"
> > allowDups="true" multiValued="true" />
> >               <copyField source="*" dest="all_text" />
> >               <field name="text_dup" type="textSpell" indexed="true"
> > stored="true" allowDups="true" />
> >               <copyField source="text" dest="text_dup" />
> >
> >       </fields>
> >       <uniqueKey>unique_key</uniqueKey>
> >       <defaultSearchField>all_text</defaultSearchField>
> >
> >       <solrQueryParser defaultOperator="OR" />
> >
> > </schema>
> >
> >
>
>
>
>



Mime
View raw message