AnsweredAssumed Answered

Solr - Mismatch character EOF expecting '''

Question asked by moraisdefreitas on Nov 30, 2014
Latest reply on Dec 1, 2014 by moraisdefreitas
I’m trying to perform a search using alfresco foundation api, but I’m facing some troubles.

Follow the log when I perform a simple search (@cm:name:\”001899.xml\") by my code:


2014-11-30 17:22:58,827  DEBUG [httpclient.wire.header] [http-bio-8080-exec-1] >> "POST /solr/alfresco/afts?wt=json&fl=DBID%2Cscore&rows=1000&df=TEXT&start=0&locale=pt_BR&alternativeDic=DEFAULT_DICTIONARY&fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts%7DTENANT_FILTER_FROM_JSON HTTP/1.1[\r][\n]"
2014-11-30 17:22:58,839  DEBUG [httpclient.wire.header] [http-bio-8080-exec-1] >> "Authorization: Basic YWRtaW46YWRtaW4=[\r][\n]"
2014-11-30 17:22:58,839  DEBUG [httpclient.wire.header] [http-bio-8080-exec-1] >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
2014-11-30 17:22:58,839  DEBUG [httpclient.wire.header] [http-bio-8080-exec-1] >> "Host: localhost[\r][\n]"
2014-11-30 17:22:58,839  DEBUG [httpclient.wire.header] [http-bio-8080-exec-1] >> "Content-Length: 292[\r][\n]"
2014-11-30 17:22:58,839  DEBUG [httpclient.wire.header] [http-bio-8080-exec-1] >> "Content-Type: application/json[\r][\n]"
2014-11-30 17:22:58,840  DEBUG [httpclient.wire.header] [http-bio-8080-exec-1] >> "[\r][\n]"
2014-11-30 17:22:58,840  DEBUG [httpclient.wire.content] [http-bio-8080-exec-1] >> "{"tenants":[""],"locales":["pt_BR"],"defaultNamespace":"http://www.alfresco.org/model/content/1.0','textAttributes":[],"defaultFTSOperator":"OR","defaultFTSFieldOperator":"OR","query":"@cm\\:name:\"001899.xml\"","templates":[],"allAttributes":[],"queryConsistency":"DEFAULT","authorities":[]}"
2014-11-30 17:22:59,161  ERROR [solr.core.SolrCore] [http-bio-8443-exec-3] org.alfresco.repo.search.impl.parsers.FTSQueryException: 10300000 line 1:1 mismatched character '<EOF>' expecting '"'


The same search performed by the node browser:


2014-11-30 17:24:10,053  DEBUG [httpclient.wire.content] [http-bio-8080-exec-4] >> "{"tenants":[""],"locales":["en_US"],"defaultNamespace":"http://www.alfresco.org/model/content/1.0','textAttributes":[],"defaultFTSOperator":"OR","defaultFTSFieldOperator":"OR","query":"@cm\\:name:\"001899.xml\"","templates":[],"allAttributes":[],"queryConsistency":"DEFAULT","authorities":["GROUP_EVERYONE","ROLE_ADMINISTRATOR","ROLE_AUTHENTICATED","admin"]}"
2014-11-30 17:24:10,116  DEBUG [httpclient.wire.header] [http-bio-8080-exec-4] << "HTTP/1.1 200 OK[\r][\n]"
2014-11-30 17:24:10,116  DEBUG [httpclient.wire.header] [http-bio-8080-exec-4] << "HTTP/1.1 200 OK[\r][\n]"
2014-11-30 17:24:10,116  DEBUG [httpclient.wire.header] [http-bio-8080-exec-4] << "Server: Apache-Coyote/1.1[\r][\n]"
2014-11-30 17:24:10,116  DEBUG [httpclient.wire.header] [http-bio-8080-exec-4] << "Content-Type: text/plain;charset=UTF-8[\r][\n]"
2014-11-30 17:24:10,116  DEBUG [httpclient.wire.header] [http-bio-8080-exec-4] << "Content-Length: 143[\r][\n]"
2014-11-30 17:24:10,116  DEBUG [httpclient.wire.header] [http-bio-8080-exec-4] << "Date: Sun, 30 Nov 2014 19:24:10 GMT[\r][\n]"
2014-11-30 17:24:10,116  DEBUG [httpclient.wire.header] [http-bio-8080-exec-4] << "[\r][\n]"
2014-11-30 17:24:10,117  DEBUG [httpclient.wire.content] [http-bio-8080-exec-4] << "{"responseHeader":{"status":0,"QTime":52},"response":{"numFound":1,"start":0,"maxScore":3.3113513,"docs":[{"DBID":["853"],"score":3.3113513}]}}"


The only difference I could notice was the authorities and the locale, but I do not believe that it is the cause.

My Java code:


      ResultSet results  = null;
      SearchParameters sp = new SearchParameters();
      sp.setLanguage(SearchService.LANGUAGE_SOLR_FTS_ALFRESCO);
      
      sp.setQuery("@cm\\:name:\"001899.xml\"");
      
      sp.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
      
      results = searchService.query(sp);

The version of Alfresco I’m using is 4.2.f.

Thanks a lot.

Outcomes