Re: fields contains equals term docs search

2019-04-22 Thread Michael Sokolov
Can you create a scoring scenario that counts the number of fields in
which a term occurs and rank by that (descending) with some kind of
post-filtering?

On Fri, Apr 19, 2019 at 11:24 AM Valentin Popov  wrote:
>
> Hi,
> I trying find the way, to search all docs has equals term on different
> fields. Like
>
> doc1 {"foo":"master", "bar":"master"}
> doc2 {"foo":"test", "bar":"master"}
>
> As result should be doc1 only.
>
> Right now, I'm get all terms for "foo", "bar" intersect it and get all
> terms could be both "foo", "bar"
> and after make huge query with all intersected items:
>
> Query query
> (String item: Intersection) {
> query.addBoolean({"foo": item, "bar": item})
> }
>
> Is any better way to find all doc's that has intersected terms?
>
> Thanks!
> --
> Regards,
> Valentin.

-
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org



Re: fields contains equals term docs search

2019-04-21 Thread Valentin Popov
It is not possible, because eliminate flexibility of fields I need search
for using old data with out reindexing.

Thanks.

сб, 20 апр. 2019 г. в 03:12, Tomoko Uchida :

> Hi,
>
> I'm not sure there are better ways to meet your requirement by
> querying, but how about considering static approaches?
> I would index an auxiliary field which has binary values (0/1 or
> "T"/"F") representing "has equals term on different fields"
> so that you can filtering out the docs (maybe by constant score query).
>
> Tomoko
>
> 2019年4月20日(土) 0:24 Valentin Popov :
> >
> > Hi,
> > I trying find the way, to search all docs has equals term on different
> > fields. Like
> >
> > doc1 {"foo":"master", "bar":"master"}
> > doc2 {"foo":"test", "bar":"master"}
> >
> > As result should be doc1 only.
> >
> > Right now, I'm get all terms for "foo", "bar" intersect it and get all
> > terms could be both "foo", "bar"
> > and after make huge query with all intersected items:
> >
> > Query query
> > (String item: Intersection) {
> > query.addBoolean({"foo": item, "bar": item})
> > }
> >
> > Is any better way to find all doc's that has intersected terms?
> >
> > Thanks!
> > --
> > Regards,
> > Valentin.
>
>
>
> --
> Tomoko Uchida
>
> -
> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-user-h...@lucene.apache.org
>
>

-- 
C Уважением
Валентин Попов.


Re: fields contains equals term docs search

2019-04-19 Thread Tomoko Uchida
Hi,

I'm not sure there are better ways to meet your requirement by
querying, but how about considering static approaches?
I would index an auxiliary field which has binary values (0/1 or
"T"/"F") representing "has equals term on different fields"
so that you can filtering out the docs (maybe by constant score query).

Tomoko

2019年4月20日(土) 0:24 Valentin Popov :
>
> Hi,
> I trying find the way, to search all docs has equals term on different
> fields. Like
>
> doc1 {"foo":"master", "bar":"master"}
> doc2 {"foo":"test", "bar":"master"}
>
> As result should be doc1 only.
>
> Right now, I'm get all terms for "foo", "bar" intersect it and get all
> terms could be both "foo", "bar"
> and after make huge query with all intersected items:
>
> Query query
> (String item: Intersection) {
> query.addBoolean({"foo": item, "bar": item})
> }
>
> Is any better way to find all doc's that has intersected terms?
>
> Thanks!
> --
> Regards,
> Valentin.



-- 
Tomoko Uchida

-
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org



fields contains equals term docs search

2019-04-19 Thread Valentin Popov
Hi,
I trying find the way, to search all docs has equals term on different
fields. Like

doc1 {"foo":"master", "bar":"master"}
doc2 {"foo":"test", "bar":"master"}

As result should be doc1 only.

Right now, I'm get all terms for "foo", "bar" intersect it and get all
terms could be both "foo", "bar"
and after make huge query with all intersected items:

Query query
(String item: Intersection) {
query.addBoolean({"foo": item, "bar": item})
}

Is any better way to find all doc's that has intersected terms?

Thanks!
-- 
Regards,
Valentin.