You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Chris M. Hostetter (Jira)" <ji...@apache.org> on 2019/12/20 00:09:00 UTC

[jira] [Reopened] (SOLR-13190) Fuzzy search treated as server error instead of client error when terms are too complex

     [ https://issues.apache.org/jira/browse/SOLR-13190?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris M. Hostetter reopened SOLR-13190:
---------------------------------------

Test is not passing reliably on jenkins...

[http://fucit.org/solr-jenkins-reports/job-data/thetaphi/Lucene-Solr-master-Linux/25179]

{noformat}
   [junit4]   2> NOTE: reproduce with: ant test  -Dtestcase=FuzzySearchTest -Dtests.method=testTooComplex -Dtests.seed=635F1779615292B3 -Dtests.multiplier=3 -Dtests.slow=true -Dtests.locale=so-DJ -Dtests.timezone=Europe/Podgorica -Dtests.asserts=true -Dtests.file.encoding=ISO-8859-1
   [junit4] FAILURE 2.47s J0 | FuzzySearchTest.testTooComplex <<<
   [junit4]    > Throwable #1: junit.framework.AssertionFailedError: Unexpected exception type, expected RemoteSolrException but got org.apache.solr.client.solrj.SolrServerException: No live SolrServers available to handle this request:[https://127.0.0.1:45243/solr/c1]
   [junit4]    >        at __randomizedtesting.SeedInfo.seed([635F1779615292B3:B5FD5D5D7E81A1F9]:0)
   [junit4]    >        at org.apache.lucene.util.LuceneTestCase.expectThrows(LuceneTestCase.java:2731)
   [junit4]    >        at org.apache.lucene.util.LuceneTestCase.expectThrows(LuceneTestCase.java:2719)
   [junit4]    >        at org.apache.solr.search.FuzzySearchTest.testTooComplex(FuzzySearchTest.java:64)
   [junit4]    >        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   [junit4]    >        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   [junit4]    >        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   [junit4]    >        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
   [junit4]    >        at java.base/java.lang.Thread.run(Thread.java:834)
   [junit4]    > Caused by: org.apache.solr.client.solrj.SolrServerException: No live SolrServers available to handle this request:[https://127.0.0.1:45243/solr/c1]
   [junit4]    >        at org.apache.solr.client.solrj.impl.LBSolrClient.request(LBSolrClient.java:345)
   [junit4]    >        at org.apache.solr.client.solrj.impl.BaseCloudSolrClient.sendRequest(BaseCloudSolrClient.java:1143)
   [junit4]    >        at org.apache.solr.client.solrj.impl.BaseCloudSolrClient.requestWithRetryOnStaleState(BaseCloudSolrClient.java:906)
   [junit4]    >        at org.apache.solr.client.solrj.impl.BaseCloudSolrClient.request(BaseCloudSolrClient.java:838)
   [junit4]    >        at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:207)
   [junit4]    >        at org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:1003)
   [junit4]    >        at org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:1018)
   [junit4]    >        at org.apache.solr.search.FuzzySearchTest.lambda$testTooComplex$0(FuzzySearchTest.java:64)
   [junit4]    >        at org.apache.lucene.util.LuceneTestCase._expectThrows(LuceneTestCase.java:2849)
   [junit4]    >        at org.apache.lucene.util.LuceneTestCase.expectThrows(LuceneTestCase.java:2724)
   [junit4]    >        ... 40 more
   [junit4]    > Caused by: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at https://127.0.0.1:45243/solr/c1: Determinizing automaton with 13632 states and 21348 transitions would result in more than 10000 states.
   [junit4]    >        at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:665)
   [junit4]    >        at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:265)
   [junit4]    >        at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:248)
   [junit4]    >        at org.apache.solr.client.solrj.impl.LBSolrClient.doRequest(LBSolrClient.java:368)
   [junit4]    >        at org.apache.solr.client.solrj.impl.LBSolrClient.request(LBSolrClient.java:296)
   [junit4]    >        ... 49 more
{noformat}

> Fuzzy search treated as server error instead of client error when terms are too complex
> ---------------------------------------------------------------------------------------
>
>                 Key: SOLR-13190
>                 URL: https://issues.apache.org/jira/browse/SOLR-13190
>             Project: Solr
>          Issue Type: Bug
>          Components: search
>    Affects Versions: 5.5, 7.7, 8.0
>            Reporter: Mike Drob
>            Assignee: Mike Drob
>            Priority: Major
>             Fix For: master (9.0)
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> We've seen a fuzzy search end up breaking the automaton and getting reported as a server error. This usage should be improved by
> 1) reporting as a client error, because it's similar to something like too many boolean clauses queries in how an operator should deal with it
> 2) report what field is causing the error, since that currently must be deduced from adjacent query logs and can be difficult if there are multiple terms in the search
> This trigger was added to defend against adversarial regex but somehow hits fuzzy terms as well, I don't understand enough about the automaton mechanisms to really know how to approach a fix there, but improving the operability is a good first step.
> relevant stack trace:
> {noformat}
> org.apache.lucene.util.automaton.TooComplexToDeterminizeException: Determinizing automaton with 13632 states and 21348 transitions would result in more than 10000 states.
> 	at org.apache.lucene.util.automaton.Operations.determinize(Operations.java:746)
> 	at org.apache.lucene.util.automaton.RunAutomaton.<init>(RunAutomaton.java:69)
> 	at org.apache.lucene.util.automaton.ByteRunAutomaton.<init>(ByteRunAutomaton.java:32)
> 	at org.apache.lucene.util.automaton.CompiledAutomaton.<init>(CompiledAutomaton.java:247)
> 	at org.apache.lucene.util.automaton.CompiledAutomaton.<init>(CompiledAutomaton.java:133)
> 	at org.apache.lucene.search.FuzzyTermsEnum.<init>(FuzzyTermsEnum.java:143)
> 	at org.apache.lucene.search.FuzzyQuery.getTermsEnum(FuzzyQuery.java:154)
> 	at org.apache.lucene.search.MultiTermQuery$RewriteMethod.getTermsEnum(MultiTermQuery.java:78)
> 	at org.apache.lucene.search.TermCollectingRewrite.collectTerms(TermCollectingRewrite.java:58)
> 	at org.apache.lucene.search.TopTermsRewrite.rewrite(TopTermsRewrite.java:67)
> 	at org.apache.lucene.search.MultiTermQuery.rewrite(MultiTermQuery.java:310)
> 	at org.apache.lucene.search.IndexSearcher.rewrite(IndexSearcher.java:667)
> 	at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:442)
> 	at org.apache.solr.search.SolrIndexSearcher.buildAndRunCollectorChain(SolrIndexSearcher.java:200)
> 	at org.apache.solr.search.SolrIndexSearcher.getDocListNC(SolrIndexSearcher.java:1604)
> 	at org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1420)
> 	at org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:567)
> 	at org.apache.solr.handler.component.QueryComponent.doProcessUngroupedSearch(QueryComponent.java:1435)
> 	at org.apache.solr.handler.component.QueryComponent.process(QueryComponent.java:374)
> 	at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:298)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:199)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:2559)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org