Frédéric, I asked a similar question several days before, it seems we don't have a perfect solution when using prefix wildcard with highlight. Here is what Chris said:
in Solr 1.1, highlighting used the info from the raw query to do highlighting, hence in your query for consult* it would highlight the Consult part of Consultant even though the prefix query was matchign the whole word. In the trunk (soon to be Solr 1.2) Mike fixed that so the query is "rewritten" to it's expanded form before highlighting is done ... this works great for true wild card queries (ie: cons*t* or cons?lt*) but for prefix queries Solr has an optimization ofr Prefix queries (ie: consult*) to reduce the likely hood of Solr crashing if the prefix matches a lot of terms ... unfortunately this breaks highlighting of prefix queries, and no one has implemented a solution yet... -----Original Message----- From: Frédéric Glorieux [mailto:[EMAIL PROTECTED] Sent: Thursday, June 07, 2007 3:52 AM To: solr-user@lucene.apache.org Subject: highlight and wildcards ? Hi all, I'm talking about solr subversion, jetty example, default documents, like the tutorial. I tried to highlight queries with wildcard. Documents are found like waited, but I haven't seen the terms highlighted. It seems to work with fuzzy search, so I thought it was a supposed feature. Am I wrong ? Tests ===== q=solr http://localhost:8983/solr/select?indent=on&version=2.2&q=solr&start=0&rows=10&fl=*%2Cscore&qt=standard&wt=standard&explainOther=&hl=on&hl.fl=features <lst name="highlighting"> <lst name="SOLR1000"> <arr name="features"> <str>Scalability - Efficient Replication to other <em>Solr</em> Search Servers</str> </arr> </lst> </lst> q=black~ (fuzzy search) see <em>black</em> and <em>clocked</em> http://localhost:8983/solr/select?indent=on&version=2.2&q=solr&start=0&rows=10&fl=*%2Cscore&qt=standard&wt=standard&explainOther=&hl=on&hl.fl=features <lst name="highlighting"> <lst name="0579B002"> <arr name="features"> <str>Printing speed up to 29ppm <em>black</em>, 19ppm color</str> </arr> </lst> <lst name="MA147LL/A" /> <lst name="EN7800GTX/2DHTV/256M"> <arr name="features"> <str>NVIDIA GeForce 7800 GTX GPU/VPU <em>clocked</em> at 486MHz</str> </arr> </lst> <lst name="100-435805"> <arr name="features"> <str>ATI RADEON X1900 GPU/VPU <em>clocked</em> at 650MHz</str> </arr> </lst> </lst> q=a* http://localhost:8983/solr/select?indent=on&version=2.2&start=0&rows=100&fl=*%2Cscore&qt=standard&wt=standard&explainOther=&hl=on&hl.fl=features&q=a* <lst name="highlighting"> <lst name="SP2514N" /> <lst name="F8V7067-APL-KIT" /> <lst name="IW-02" /> <lst name="MA147LL/A" /> <lst name="VDBDB1A16" /> <lst name="3007WFP" /> <lst name="VA902B" /> <lst name="0579B002" /> <lst name="9885A004" /> <lst name="SOLR1000" /> <lst name="UTF8TEST" /> <lst name="EN7800GTX/2DHTV/256M" /> <lst name="100-435805" /> </lst> -- Frédéric Glorieux École nationale des chartes direction des nouvelles technologies et de l'informatique