Uploaded image for project: 'Nuxeo Studio'
  1. Nuxeo Studio
  2. NXS-2864

Fix generated query for elasticsearch fulltext + fuzzy search combination

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: 25
    • Fix Version/s: None
    • Component/s: Content Views
    • Tags:
    • Sprint:
      nxNag Sprint 8.1.1
    • Story Points:
      2

      Description

      Using Nuxeo Platform 7.3 target Platform
      In Nuxeo Studio, create a content view using elasticsearch index.
      In the search layout, use the fulltext widget.

      Fulltext widget options:

      • Operator: FULLTEXT

      Hints

      • Index: dc:title.fulltext
      • Analyzer: empty value
      • Operator: fuzzy
      • Widget Type: text

      Save, deploy.
      When using the search form, the generated query is incorrect: WHERE

      ecm:fulltext./*+ES

      ... should not have ecm:fulltext.

      2015-09-02 16:10:20,167 DEBUG [http-bio-0.0.0.0-8080-exec-4][org.nuxeo.elasticsearch.query.NxqlQueryConverter] Syntax error: Invalid token <INDEX> at offset 49 for query:
      SELECT * FROM Document WHERE ecm:fulltext./*+ES: INDEX(dc:title.fulltext) OPERATOR(fuzzy) */ ecm:fulltext = 'searchTerm' AND (ecm:mixinType != 'HiddenInNavigation'  AND ecm:isCheckedInVersion = 0  AND ecm:currentLifeCycleState != 'deleted'  AND ecm:primaryType = 'BCContract'){{RemoteAddr,127.0.0.1}{RequestURL,http://localhost:8080/nuxeo/search/search.faces}{ServletPath,/search/search.faces}{SessionID,281CBF8F8FD4527D70ED05FD0F7AEC41.nuxeo}{UserPrincipal,Administrator}}
      2015-09-02 16:10:20,167 WARN  [http-bio-0.0.0.0-8080-exec-4][org.nuxeo.elasticsearch.provider.ElasticSearchNxqlPageProvider] Syntax error: Invalid token <INDEX> at offset 49{{RemoteAddr,127.0.0.1}{RequestURL,http://localhost:8080/nuxeo/search/search.faces}{ServletPath,/search/search.faces}{SessionID,281CBF8F8FD4527D70ED05FD0F7AEC41.nuxeo}{UserPrincipal,Administrator}}
      org.nuxeo.ecm.core.query.QueryParseException: Syntax error: Invalid token <INDEX> at offset 49
      	at org.nuxeo.ecm.core.query.sql.parser.parser.parseFailed(parser.java:519)
      	at org.nuxeo.ecm.core.query.sql.parser.parser.unrecovered_syntax_error(parser.java:510)
      	at java_cup.runtime.lr_parser.parse(lr_parser.java:601)
      	at org.nuxeo.ecm.core.query.sql.SQLQueryParser.parse(SQLQueryParser.java:39)
      	at org.nuxeo.elasticsearch.query.NxqlQueryConverter.getSqlQuery(NxqlQueryConverter.java:182)
      	at org.nuxeo.elasticsearch.query.NxqlQueryConverter.toESQueryBuilder(NxqlQueryConverter.java:94)
      	at org.nuxeo.elasticsearch.query.NxQueryBuilder.makeQuery(NxQueryBuilder.java:226)
      	at org.nuxeo.elasticsearch.query.NxQueryBuilder.updateRequest(NxQueryBuilder.java:319)
      	at org.nuxeo.elasticsearch.core.ElasticSearchServiceImpl.buildEsSearchRequest(ElasticSearchServiceImpl.java:186)
      	at org.nuxeo.elasticsearch.core.ElasticSearchServiceImpl.search(ElasticSearchServiceImpl.java:172)
      	at org.nuxeo.elasticsearch.core.ElasticSearchServiceImpl.queryAndAggregate(ElasticSearchServiceImpl.java:105)
      	at org.nuxeo.elasticsearch.ElasticSearchComponent.queryAndAggregate(ElasticSearchComponent.java:498)
      	at org.nuxeo.elasticsearch.provider.ElasticSearchNxqlPageProvider.getCurrentPage(ElasticSearchNxqlPageProvider.java:94)
      	at org.nuxeo.elasticsearch.provider.ElasticSearchNxqlPageProvider.getAggregates(ElasticSearchNxqlPageProvider.java:170)
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: