Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User

how to put multiplue proximity search in lucene??

 

 

Lucene java-user RSS feed   Index | Next | Previous | View Threaded


neerajshah84 at gmail

Jul 24, 2012, 10:13 PM

Post #1 of 4 (268 views)
Permalink
how to put multiplue proximity search in lucene??

how can i put multiplue proximity search in lucene??
example :-

i want to search like "fear,dark" in two words and dark adjucent to "tight"
and tight,free in 3 words.

Query :- fear2dark tight3free

how can i do this in lucene??



--
View this message in context: http://lucene.472066.n3.nabble.com/how-to-put-multiplue-proximity-search-in-lucene-tp3997139.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


ian.lea at gmail

Jul 25, 2012, 1:52 AM

Post #2 of 4 (261 views)
Permalink
Re: how to put multiplue proximity search in lucene?? [In reply to]

If you are using QueryParser use "fear dark"~2 "tight free"~3.

See also PhraseQuery.setSlop(n). You could also look at the Span
queries e.g. SpanNearQuery.


--
Ian.


On Wed, Jul 25, 2012 at 6:13 AM, neerajshah84 <neerajshah84 [at] gmail> wrote:
> how can i put multiplue proximity search in lucene??
> example :-
>
> i want to search like "fear,dark" in two words and dark adjucent to "tight"
> and tight,free in 3 words.
>
> Query :- fear2dark tight3free
>
> how can i do this in lucene??
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/how-to-put-multiplue-proximity-search-in-lucene-tp3997139.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
> For additional commands, e-mail: java-user-help [at] lucene
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


neerajshah84 at gmail

Jul 25, 2012, 10:02 PM

Post #3 of 4 (255 views)
Permalink
Re: how to put multiplue proximity search in lucene?? [In reply to]

fear2dark tight3free is one single query and im using query parser. If i
will pass
"fear dark"~2 "tight free"~3 then i will not get result in which dark
and tight near to eachother. and also

"fear dark"~2 "tight free"~3 will give me two different results then how
will i be able to take the intersection of two results??


On Wed, Jul 25, 2012 at 2:23 PM, Ian Lea [via Lucene] <
ml-node+s472066n3997169h76 [at] n3> wrote:

> If you are using QueryParser use "fear dark"~2 "tight free"~3.
>
> See also PhraseQuery.setSlop(n). You could also look at the Span
> queries e.g. SpanNearQuery.
>
>
> --
> Ian.
>
>
> On Wed, Jul 25, 2012 at 6:13 AM, neerajshah84 <[hidden email]<http://user/SendEmail.jtp?type=node&node=3997169&i=0>>
> wrote:
>
> > how can i put multiplue proximity search in lucene??
> > example :-
> >
> > i want to search like "fear,dark" in two words and dark adjucent to
> "tight"
> > and tight,free in 3 words.
> >
> > Query :- fear2dark tight3free
> >
> > how can i do this in lucene??
> >
> >
> >
> > --
> > View this message in context:
> http://lucene.472066.n3.nabble.com/how-to-put-multiplue-proximity-search-in-lucene-tp3997139.html
> > Sent from the Lucene - Java Users mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3997169&i=1>
> > For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3997169&i=2>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3997169&i=3>
> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3997169&i=4>
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://lucene.472066.n3.nabble.com/how-to-put-multiplue-proximity-search-in-lucene-tp3997139p3997169.html
> To unsubscribe from how to put multiplue proximity search in lucene??, click
> here<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3997139&code=bmVlcmFqc2hhaDg0QGdtYWlsLmNvbXwzOTk3MTM5fC0yMzgzODQ1OA==>
> .
> NAML<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



--
With Regards,
Neeraj Kumar Shah
+919819474146




--
View this message in context: http://lucene.472066.n3.nabble.com/how-to-put-multiplue-proximity-search-in-lucene-tp3997139p3997366.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


iorixxx at yahoo

Jul 26, 2012, 7:37 AM

Post #4 of 4 (256 views)
Permalink
Re: how to put multiplue proximity search in lucene?? [In reply to]

> fear2dark tight3free is one single
> query and im using query parser. If i
> will pass
>   "fear dark"~2 "tight free"~3  then i will not
> get result in which dark
> and tight near to eachother.

So you want to be dark and tight adjacent to each other. SurroundQueryParser support nested proximity search.
It has operators for both unordered and ordered query.
Your query would be something like this:
(fear 2w dark) w (tight 3w free)


http://wiki.apache.org/solr/SurroundQueryParser
http://www.lucidimagination.com/blog/2009/02/22/exploring-query-parsers/
http://lucene.apache.org/core/3_6_1/api/all/org/apache/lucene/queryParser/surround/parser/package-summary.html

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene

Lucene java-user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.