Skip to content

Commit

Permalink
feat: fixed NEAR operator being order sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
romanchyla committed Feb 2, 2022
1 parent d5d9ec0 commit 7aa2d9d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,13 @@ public void testSpecialCases() throws Exception {
"//*[@numFound='1']",
"//doc/str[@name='id'][.='61']");

// check NEAR ignores order
assertQ(req("q", "title:(rotation NEAR2 profile)"),
"//*[@numFound='1']",
"//doc/str[@name='id'][.='61']");
assertQ(req("q", "title:(profile NEAR2 rotation)"),
"//*[@numFound='1']",
"//doc/str[@name='id'][.='61']");

assertQEx("INVALID_SYNTAX", req("q", "author:\"^\"de marco year:2015"), 400);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class AqpNearQueryNode extends QueryNodeImpl implements QueryNode {

private static final long serialVersionUID = 8806759327487974314L;
private Integer slop = null;
private boolean inOrder = true;
private boolean inOrder = false;

public AqpNearQueryNode(List<QueryNode> children, int proximity) {
if (children == null) {
Expand Down

0 comments on commit 7aa2d9d

Please sign in to comment.