You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Daniel Shane <sh...@lexum.com> on 2010/05/20 19:28:29 UTC

Solr highlighter and custom queries?

Hi all!

I'm trying to do some simple highlighting, but I cannot seem to figure out how to make it work.

I'm using my own QueryParser which generates custom made queries. I would like Solr to be able to highlight them.

I've tried many options in the highlighter but cannot get any snippets to show.

However, if I change the QueryParser to the default solr parser it works.

There is certainly a place in the config or in the query parser where I can specify how Solr can highlight my custom queries?

I checked a bit in the source code, and in WeightedSpanTermExtractor class, in the method extract(Query query, Map terms), there is a huge list of instanceof's that check which type of query we are attempting to match.

Is that the only place where the conversion between query <-> highlighting happens? If so, its looks pretty hard coded and would not work with any other queries than the ones included in Lucene.

I guess there must be a good reason for this, but is there any other way of making the highlighter work without having to hard code all the possible queries in a big if / instanceofs?

If we could somehow reuse the code contained in each query to find possible matches, it would avoid having to recode the same logic elsewhere.

But as I said, there must be a good reason for doing it the way its already coded.

Any ideas on how to work this out with the existing code base would be greatly appreciated :)

Daniel Shane


Re: Debugging - DIH Delta Queries-

Posted by Chris Hostetter <ho...@fucit.org>.
: Subject: Debugging - DIH Delta Queries- 
: References:
:     <16...@vicenza.dmz.lexum.pri>
: In-Reply-To:
:     <16...@vicenza.dmz.lexum.pri>

http://people.apache.org/~hossman/#threadhijack
Thread Hijacking on Mailing Lists

When starting a new discussion on a mailing list, please do not reply to 
an existing message, instead start a fresh email.  Even if you change the 
subject line of your email, other mail headers still track which thread 
you replied to and your question is "hidden" in that thread and gets less 
attention.   It makes following discussions in the mailing list archives 
particularly difficult.
See Also:  http://en.wikipedia.org/wiki/User:DonDiego/Thread_hijacking




-Hoss


Debugging - DIH Delta Queries-

Posted by Vladimir Sutskever <Vl...@jpmorgan.com>.
Hi All,

How can I see all of the queries sent to my DB during a Delta Import?

It seems like my documents are not being updated via delta import
When I use SOLR's DataIMport Handler Console - with delta-import selected I see

<lst name="entity:getall">
<lst name="document#1"/>
</lst>
−
<lst name="entity:getall">
<lst name="document#1"/>
</lst>
−
<lst name="entity:getall">
<lst name="document#1"/>
</lst>


But that’s not very helpful - I want to see the exact queries


Thank You


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.