different search result from [Alfresco share] and using REST API Search/Solr6

cancel
Showing results for 
Search instead for 
Did you mean: 
pawel_w_s
Member II

different search result from [Alfresco share] and using REST API Search/Solr6

Hi All,

Im facing some problem, for which Im not finding any reasonable answear.

I have clean install of Alfresco Community Edition 7.3 (docker). I add test files with names test_1.txt, 1.txt, 1-1.txt, 1-2.txt. All of them are simple text files containig one word [test].

When Im using Alfresco Share app, Node Browser -> in query use TEXT:test, language [fts-alfresco] it gives me 9 results (it includes also some default files from Alfresco instance). So it works as I expect and search also in files content.

On the other hand when Im trying to get same result using search API

http://localhost:8080/alfresco/api/-default-/public/search/versions/1/search

 using body:

{
    "query": {
       "language": "afts",
       "query": "TEXT:test"
    },
    "fields": ["id", "name", "search"],
    "sort": {
    		"type": "SCORE"
    }
}

in response I get only 6 files, it does not contain files where file content have word test inside, but not in name.

What's more, querying Solr6 from admin panel (http://localhost:8083/solr/#/alfresco/query), with query [TEXT:test], also provide only 6 results. So Solr6 and REST API works the same way.

Questions:

why Alfresco share Node Browser return more results?

why Solr6 does not return files by content?

(I noticed that in version 7.3 by default Solr properties in file [shared.properties] have comment out to index context. Uncomment this configuration helped.)

Thank you very much for any help.

1 Reply
angelborroy
Alfresco Employee

Re: different search result from [Alfresco share] and using REST API Search/Solr6

By default Share is searching also in Name, Title, Description and TAG properties.

You may create an equivalent query in AFTS Syntax for Node Browser / REST API. Or just remove the "TEXT:" from your AFTS query to get results from default text fields:

https://github.com/Alfresco/InsightEngine/blob/master/search-services/alfresco-search/src/main/java/...

Hyland Developer Evangelist