Implicit join in lucene

2019-08-05 06:06发布

Is it possible to do something like the following in lucene? If not, can you give any suggestions for how to get around this limitation?

SELECT
start.dt AS eventstarttime,
last.dt AS eventfinishtime
WHERE
start.evt:"Started" AND last.evt:"Ended" AND start.evtgrpid = last.evtgrpid

标签: join lucene
1条回答
Summer. ? 凉城
2楼-- · 2019-08-05 06:20

Your question does not give enough information to fully answer it. This SQL is not even valid - where is the FROM clause (for a start)?

Suggestion 1: run two queries ("Started" and "Ended") separately and merge the results based on evtgrpid.

Suggestion 2: run one query (e.g. "Started") and filter the results based on "Ended" criteria.

Suggestion 3: do not use Lucene for what databases are built for. Really. Often database logic does not even apply to Lucene (e.g. what if stopwords are used when indexing?).

查看更多
登录 后发表回答