Full text Query

Hello!

I'm trying to search using a full-text query.

As I have to search into a specific field I'm trying to use the property: ecm:fulltext.somefield = 'something' but it doesn't work for me.

Any idea?

Here is my code: ecm:fulltext.act:subject = 'string*'

0 votes

1 answers

949 views

ANSWER



Hello,

You need to update the default ES config of your Nuxeo instance so that the full text works on your custom field: https://doc.nuxeo.com/nxdoc/configuring-the-elasticsearch-mapping/#adding-a-new-full-text-field.

Regards

1 votes



Thank you for your answer.

I have updated what you said. However, when I try to search with the following queries, I don't get any result:

Query 1: SELECT * FROM Document WHERE ecm:mixinType != 'HiddenInNavigation' AND ecm:isProxy = 0 AND ecm:isVersion = 0 AND ecm:isTrashed = 0 AND ecm:fulltext.act:subtitle = 'prueba'

Query 2: SELECT * FROM Document WHERE /+ES: INDEX(act:subtitle.fulltext) ANALYZER(fulltext) OPERATOR(match) / act:subtitle= 'prueba'

In order to form the second one, I used the following property from the elasticsearch-doc-mapping.json :

"act:subtitle": {

        "type": "text",
        "fielddata": true,
        "fields": {
            "fulltext": {
                "analyzer": "fulltext",
                "type": "text"
            },
            "lowercase": {
                "type": "text",
                "analyzer": "lowercase_analyzer"
            }
        }
    }"

The value of act:subtitle is 'prueba de subtítulo' and if I make my search with the whole value I get what I want..

Do you know where is the error?

Thanks again

Regards

05/27/2020

Hello, I think you should use the "like" operator instead of "=" so your request looks like this : SELECT * FROM Document WHERE ….. AND ecm:fulltext.act:subtitle like 'prueba%'
06/02/2020