distance restriction query over parallel indexes

10 views
Skip to first unread message

Dmitri Portnov

unread,
Nov 3, 2015, 6:57:56 AM11/3/15
to mg...@googlegroups.com, vi...@di.unimi.it

Hi everybody,

 

I have a “parallel” index for the words and some attributes of the words: semantic, sentiment, speech part, case etc.

It’s possible to  query mg4j with something like speech:V^sentiment:neg – select documents with the verbs having negative sentiment.

It’s possible to use distance query, for example (MAN BELIEVE)~3 works on  default index field “text”, the distance query over other index fields also work: sem:(PersonName Organization*)~2 – searches for the document having person names mentioned near organization names.

My problem is to apply distance filter over different fields:

(sem:PersonName sentiment:neg)~3. In this case the query returns all the data satisfying the inner query ignoring the specified distance.

 

Is it possible to organize indexing and query parsing to make them sensitive to distance in terms over different fields of the index?

 

Regards, Dmitri.

Sebastiano Vigna

unread,
Nov 3, 2015, 7:26:31 AM11/3/15
to Dmitri Portnov, mg...@googlegroups.com
You can always remap an index into another using the remap operator {{ -> }}. There are examples in the manual, and it is documented here

http://mg4j.di.unimi.it/docs/it/unimi/di/mg4j/search/package-summary.html

Ciao,

seba

Dmitri Portnov

unread,
Nov 3, 2015, 10:10:39 AM11/3/15
to Sebastiano Vigna, mg...@googlegroups.com
Thanks, that works without any changes in program and indexes.

((sem:PersonName {{sem -> text}}) BELIEVE)~3 - finds all the persons near the word "believe".
Reply all
Reply to author
Forward
0 new messages