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 <john77e...@gmail.com> wrote: > I have this line highlighted > > <em>Jobs</em> was <em>born</em> 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 <erickerick...@gmail.com> 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 <john77e...@gmail.com> 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 " <FUZZY_SLOP> "~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 > > >