cancel
Showing results for 
Search instead for 
Did you mean: 

Searching with AND logical operator

frankp
Champ in-the-making
Champ in-the-making
We are using Alfresco Community Edition 4.2.c (Windows 64 bit and Linux platform).
Doing a research restricted to file names using the AND logical operator (example: server AND cluster) the results aren't that expected.
We want only the documents containing the words "server" AND the words "cluster" but the documents showed are thats containing one or more of the words: "server", "AND", "cluster" !
Using the sintax "+server +cluster" the results shows the documents containing one or more of the words "server" or "cluster" !

What is our mistake ?

Thanks !
7 REPLIES 7

resplin
Elite Collaborator
Elite Collaborator
The search syntax you want is "server AND cluster".

To restrict it to just filenames, you would use the "name:" metadata scope: "name:server AND name:cluster". That would match a filename like "Server14 Cluster5.pdf"

By default, Alfresco will not do a suffix or substring search. So it will only match on strings that are separated by whitespace. This is often not the case in filenames, so you might want to include the wildcard operator in order to catch names like server14_cluster5.pdf. The search string would be "name:*server AND name:*cluster".

The syntax is documentation is here:

http://docs.alfresco.com/4.1/topic/com.alfresco.enterprise.doc/concepts/rm-searchsyntax-intro.html#1

frankp
Champ in-the-making
Champ in-the-making
Resplin, thanks for your reply but our problems remains.

We are searching using the text box in the upper right corner in the Alfresco Explorer window.

When we use the sintax "name:server" no documents are returned.
When we simply use the word "server" the documents containing the word server in the file name or in the contents are returned.
When we simply use the word "server" and select the "file names only" in the list box on the left of text  box, only the documents containing the word server in the file name are returned.

Using the logical operator AND, the problem is that the word "AND" is treated as a normal word !
Searching for "server AND cluster", Alfresco returns all the documents tha have the word "server" OR the word "cluster" OR the word "AND" in the file name or in the contents.
Selecting the  "file names only" in the list box, we can restrict the research only to filenames but the "AND problem" remains !

abr
Champ in-the-making
Champ in-the-making
I don't think you can restrict a search to only one occurrence of a term. I don't see any syntax for this feature in the doc api.
The closest syntax of your needs is : +server +cluster.

resplin
Elite Collaborator
Elite Collaborator
I tested my answer against Alfresco Share, and I'm surprised the behavior in Explorer isn't the same (I would expect "and" to be a stopword in the index).

Hopefully someone who is more familiar with the Explorer interface can offer more help.

andy
Champ on-the-rise
Champ on-the-rise
HI

Share exposes Alfresco FTS direct.

The explorer client has its own query builder that does other things and builds a query string for you.
Do not expect Alfresco FTS here.

http://docs.alfresco.com/3.4/index.jsp?topic=%2Fcom.alfresco.Enterprise_3_4_0.doc%2Fconcepts%2Frm-se...

There used to be more on the wiki somewhere ….

You can configure default AND or OR behaviour for the explorer search.
I suspect the query builder is ORing the terms regardless of the +.
You can change the default to AND if that helps.

There have been some bug fixes in this area.
It may have been doing

(match term one in any of the searched fields) and (match term two in any of the search fields)

which will also broaden the search unexpectedly

Andy

frankp
Champ in-the-making
Champ in-the-making
Thanks for your suggestions !
Searching in Alfresco Share with the sintax "name:server and name:cluster" only the documents with both the terms in the file name are founded.

Remains a problem: the search do not works for same subfolders.
We have this structure:
Repository
    |———Sites
                    |———Presidio CED
                                       |———–Documents

The same documents are in the "Presidio CED" and "Documents" folders but only that in the "Presidio CED" folder are founded !
Are there limits in the deep of subfolders using the search feature ?

frankp
Champ in-the-making
Champ in-the-making
I have seen that the format of the previous post is showed incorrectly.
The folder listed are all nested: "Sites" is a subfolder of "Repository", "Presidio CED" a subfolder of "Sites" and "Documents" a subfolder of "Presidio CED".
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.