well ok I guess that makes sense and I tried changing my title field to text type and then highlighting worked on it .. but 1) as far as not merging all fields in catchall field and instead configuring the dismax handler to search through them .. do you mean then ill have to specify the field I want to do the search in .. e.g. q=something&hl.fl=title or q=somethingelse&hl.fl=status .. and another thing is that I have abuot 20 some fields which I am merging in my catch all fields .. with that many fields do you still think its better to use dismax or catchall field ???
2) secondly for highlighting q=title:searchterm also didnt worked .. it only works if I change the type of title field to text instead of string .. even if I give the full string in q param .. it still doesnt highlights it unless like I said I change the field type to text ... so why is that .. and if thats just how it is and I have to change some of my fields to text .. then my question is that solr will analyze them first their own field and then copy them to the catchall field while doing the analysis one more time .. since catchall field is also text .. i guess this is just more of a understanding question thanks for all u guys help Ahmet Arslan wrote: > >> hi >> i am trying to get highlighting working and its turning out >> to be a pain. >> here is my schema >> >> <field name="id" type="string" indexed="true" >> stored="true" required="true" >> /> >> <field name="title" type="string" indexed="true" >> stored="true" /> >> <field name="pi" type="string" indexed="true" >> stored="true" /> >> <field name="status" type="string" indexed="true" >> stored="true" /> >> >> here is the catchall field (default field for search as >> well) >> <field name="content" type="text" indexed="true" >> stored="false" >> multiValued="true"/> >> >> here is how I have setup the solrconfig file >> <!-- example highlighter config, enable per-query with >> hl=true --> >> <str name="hl.fl">title pi >> status</str> >> <!-- for this field, we want no >> fragmenting, just highlighting --> >> <str >> name="f.name.hl.fragsize">0</str> >> <!-- instructs Solr to return >> the field itself if no query terms are >> found --> >> <str >> name="f.title.hl.alternateField">content</str> >> <str >> name="f.pi.hl.alternateField">content</str> >> <str >> name="f.status.hl.alternateField">content</str> >> >> <str >> name="f.title.hl.fragmenter">regex</str> <!-- >> defined below --> >> <str >> name="f.pi.hl.fragmenter">regex</str> <!-- >> defined below --> >> <str >> name="f.status.hl.fragmenter">regex</str> <!-- >> defined below --> >> >> after this when I search for lets say >> http://localhost:8983/solr/select?q=submit&hl=true >> I get these results in highlight section >> <lst name="highlighting"> >> <lst name="FP00001934" /> >> <lst name="FP00001934-PR02" /> >> <lst name="FP00001934-PR03" /> >> <lst name="FP00000526" /> >> <lst name="FP00000385" /> >> </lst> >> with no reference to the actual string .. this number thats >> being returned >> is the id of the records .. and is also the unique >> identifier .. why am I >> not getting the string fragments with search terms >> highlighted > > You need to change type of fields (title, pi, staus) from string to text > (same as content field). > > There should be a match/hit on that field in order to create highlighted > snippets. > > For example q=title:submit should return documents so that snippet of > title can be generated. > > FYI: You can search title, pi, status at the same time using > http://wiki.apache.org/solr/DisMaxRequestHandler without copying all of > them into a catch all field. > > > > > > > > -- View this message in context: http://old.nabble.com/highlighting-fragments-EMPTY-tp27654005p27661657.html Sent from the Solr - User mailing list archive at Nabble.com.