Yes. It seems to work for Default Highlighting. I'm using Fast Vector
Highlighter.
Let me also explain why I went for Fast Vector Highlighter. I wanted the
highlighted content to be complete and not broken words and for that I
need to use breakIterator which works only for Fast vector highlighting.
Here is my request log.
SENTENCE
200
true
score desc
#
content_raw
true
content_raw
en
10
true
content_raw:"born Jobs"~10
#
US
breakIterator
Regards,
John Eipe
“The Roots of Violence: Wealth without work, Pleasure without conscience,
Knowledge without character, Commerce without morality, Science without
humanity, Worship without sacrifice, Politics without principles”
- Mahatma Gandhi
On 27 October 2014 18:46, david.w.smi...@gmail.com wrote:
> John,
> I’m not seeing this problem. Presumably we’re talking about the default
> highlighter (the most accurate one) but I figure the others would match it
> too. To test, I added the following to HighlightTest.java in Solr and this
> test passed:
>
> @Test
> public void testSpan() {
> final String field = "t_text";
> assertU(adoc(field, "Jobs was born in San Francisco, California on
> February \n" +
> "24 1955.", "id", "1"));
> assertU(commit());
> assertQ("span",
> req("q", "\"born Jobs\"~15",
> "hl", "true", "df", field),
> "//lst[@name='highlighting']/lst[@name='1']" );
> }
>
> ~ David Smiley
> Freelance Apache Lucene/Solr Search Consultant/Developer
> http://www.linkedin.com/in/davidwsmiley
>
> On Mon, Oct 27, 2014 at 8:12 AM, john eipe wrote:
>
> > I have this line highlighted
> >
> > Jobs was born in San Francisco, California on February
> > 24 1955.
> >
> > for query "Jobs born"~15 but not for "born Jobs"~15. I want the same
> result
> > irrespective of the order of search keywords.
> >
> > Regards,
> > John Eipe
> >
> > “The Roots of Violence: Wealth without work, Pleasure without conscience,
> > Knowledge without character, Commerce without morality, Science without
> > humanity, Worship without sacrifice, Politics without principles”
> > - Mahatma Gandhi
> >
> > On 25 October 2014 18:25, Erick Erickson
> wrote:
> >
> > > Well, the syntax is wrong. You probably want content_raw:"jobs
> > > born"~15. The way slop works, it is the number of "moves" so this will
> > > match "jobs was a man born somewhere" and "all persons born include
> > > jobs". The difference is that the version that has "born" first and
> > > "jobs" second will take an extra move, so if the search is "jobs born"
> > > and the text was "born jobs", the second one would require more slop.
> > >
> > > Best,
> > > Erick
> > >
> > > On Sat, Oct 25, 2014 at 2:48 AM, john eipe
> wrote:
> > > > Hi
> > > >
> > > > I'm trying to match keywords based on 2 fields and excluding order
> > > > importance but with distance restriction.
> > > >
> > > > title:(Jobs) AND content_raw:(Jobs born)~15
> > > >
> > > > This throws error:
> > > > org.apache.solr.search.SyntaxError: Cannot parse '(Jobs born)~15':
> > > > Encountered " "~15 "
> > > >
> > > > What's the correct way to frame this query?
> > > >
> > > > Regards,
> > > > *John Eipe*
> > > >
> > > > “The Roots of Violence: Wealth without work, Pleasure without
> > conscience,
> > > > Knowledge without character, Commerce without morality, Science
> without
> > > > humanity, Worship without sacrifice, Politics without principles”
> > > > - Mahatma Gandhi
> > >
> >
>