cancel
Showing results for 
Search instead for 
Did you mean: 

I really need help with Lucene querys

jtorres
Champ in-the-making
Champ in-the-making
Hi people:

I'm really confused with lucene querys, it seems like documentation examples doesnt works all right. I'm trying to make a function to search by exact name, but the query doesn't works. This is the query:


"@cm\\:name:"+ "\""+name+"\""

If name = "Test folder" for example it doesn't returns "Test Folder" only, it returns all files containing "Test" or "Folder" words. What's wrong?

Thanks.
3 REPLIES 3

kevinr
Star Contributor
Star Contributor
You may have hit the issue where the 'short name' form of the URI used in search does not always work - the fully qualified form does work - can you try this instead:

@\{http\://www.alfresco.org/model/content/1.0\}name:'Test Folder"

I generate this kind of search for the Simple/Advanced Search screens in the web-client.

Thanks,

Kevin

jtorres
Champ in-the-making
Champ in-the-making
Thanks Kevin, I've allready tried this but the results are not allright. I suposse I'm doing something wrong or perhaps Lucene querys not perfect still. This is my query in Java:


"@\\{http\\://www.alfresco.org/model/content/1.0\\}name:'+ "\""+filename+"\""

Thanks for your help Kevin.

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

cm:name is tokenised - so its exact form is not in the index.

See http://wiki.alfresco.com/wiki/Search#Understanding_tokenisation

So you can
1) Do the search and then do a post filter for exact matches
2) Try to do this in the query - which will always give some problems
  - the results should be an exact match for the phrase
3) Treat this field as an id - then it is never tokenised and always does an exact match.

What are the other matches?
Are they equivalent except for stop words?
(eg 1) Test Folder
      2) test and folder
      3) test or folder   
)

Regards

Andy
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.