I really need help with Lucene querys

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2006 06:15 AM
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:
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.
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.
Labels:
- Labels:
-
Archive
3 REPLIES 3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2006 11:51 AM
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:
I generate this kind of search for the Simple/Advanced Search screens in the web-client.
Thanks,
Kevin
@\{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

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2006 05:54 AM
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:
Thanks for your help Kevin.
"@\\{http\\://www.alfresco.org/model/content/1.0\\}name:'+ "\""+filename+"\""
Thanks for your help Kevin.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2007 07:34 AM
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
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
