Monitor.update() silently fails with leading wildcards
noofherder opened this issue · 1 comments
noofherder commented
Monitor monitor = new Monitor(new LuceneQueryParser("text"), new TermFilteredPresearcher());
monitor.update(new MonitorQuery("1", "foo"));
monitor.update(new MonitorQuery("2", "foo*"));
monitor.update(new MonitorQuery("3", "*foo"));
monitor.update(new MonitorQuery("4", "foo?"));
monitor.update(new MonitorQuery("5", "?foo"));
System.out.println("query IDs: " + monitor.getQueryIds());
System.out.println("query 1: " + monitor.getQuery("1"));
System.out.println("query 3: " + monitor.getQuery("3"));
outputs:
query IDs: [1, 2, 4]
query 1: 1: foo
query 3: null
romseygeek commented
In luwak 1.4.0, update() returns a list containing any errors, which needs to be checked. In 1.5.0 an UpdateException is thrown instead.