cancel
Showing results for 
Search instead for 
Did you mean: 

Exact name query

benjamin_doughe
Champ in-the-making
Champ in-the-making
Hi all,

I have created 2 files with the names "bob" and "bob friend"
When I do the following query:

@cm\:name:bob

in the node browser I get both returned. Is there a query which allows an exact match so only "bob" is returned.

I understand the reason "bob friend" is being returned because "bob" and "friend" are tokenised.

Thanks for any help,
Ben.
6 REPLIES 6

kevinr
Star Contributor
Star Contributor
@cm\:name:"bob"

may give you what you want.

Kevin

benjamin_doughe
Champ in-the-making
Champ in-the-making
Thanks for the quick responce, unfortunately that didn't seem to work. It still returns both "bob" and "bob friend":


Search
Search Language:   lucene
Search:   @cm\:name:"bob"

Results (2 rows)
Name   Node   Parent
{http://www.alfresco.org/model/content/1.0}bob   workspace://SpacesStore/52771e17-f966-11db-ba12-57a41379f1a3   workspace://SpacesStore/73569c60-e8fc-11db-912a-c1b3c759d3a2
{http://www.alfresco.org/model/content/1.0}bob_x0020_friend   workspace://SpacesStore/5c28f4f0-f966-11db-ba12-57a41379f1a3   workspace://SpacesStore/73569c60-e8fc-11db-912a-c1b3c759d3a2


ta,
Ben.

andy
Champ on-the-rise
Champ on-the-rise
Hi

There is no way to do what you want….

You would have to add "not any token that is not bob" which would be quite expensive to do. This will find everything that does not match bob and invert it.

If you want identifiers you can declare attributes to be untokenised.
An exact match is then always going to happen as there is ony one token.

You could filter the results for the exact match.

It is possible that the score can help here - an exact match of one token should score higher likely1.0, while the other doc will score lower related to the number of tokens. If not is possible to tweak scoring. We  have not really worried about scoring and taken the lucene default. Stop words will stuff this up …The bob is liely to be the same as the "the" will be excluded.

Hope this helps a bit …

Andy

sanket
Champ on-the-rise
Champ on-the-rise
I faced a similar issue. But it seems that the above discussion was in with reference to an older alfresco version.
I am working with Alfresco4.1.3.
I made my exact search work by prefixing the property name with "=" operator.
For example:  =cm:customproperty:"abc"

Courtesy : http://docs.alfresco.com/4.2/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Fconcepts%2Frm-searchsy...

Other option is to make the tokenized attribute to false in your model file.
http://docs.alfresco.com/4.1/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Fconcepts%2Fsearch-fts-...

jaynil_bagdai
Champ in-the-making
Champ in-the-making
Hi Sanket,

I tried the same "=" operator to retrieve exact search. But it didn't helped.

yogeshpj
Star Contributor
Star Contributor
Hi Benjamin,

"cm:name" is out of the box property and it is behaving like this as it is declared as tokenized "both" for supporting full text search in out of the box alfresco.

Ideally,you should not change that behavior.

I would suggest to use custom property instead of it and make that property as tokenized "false" as suggest by sanket.

Thanks,
Yogesh Prajapati