Lucene query doesn't work right?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2006 06:06 AM
Hi people:
I'm trying to search a node by its name. If I find by exact name the query works perfect:
However if I try to search by aproximation the query doesn't works:
Thanks a lot peope.
I'm trying to search a node by its name. If I find by exact name the query works perfect:
"@\\{http\\://www.alfresco.org/model/content/1.0\\}name:'+name
However if I try to search by aproximation the query doesn't works:
"@\\{http\\://www.alfresco.org/model/content/1.0\\}name: "+ name+"~"or"@\\{http\\://www.alfresco.org/model/content/1.0\\}name:'+ name +"*"
I obtain a lot of results that doesn't match with the query. What's wrong here?Thanks a lot peope.
Labels:
- Labels:
-
Archive
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2006 08:57 AM
I've seen that it's a problem with names containing spaces, Lucene doesn't work correctly with them. If I try to search "SampleContent" it works fine, but if I try to find "Test Folder" it doesn't works.
Is there any problem with spaces in Lucene? :?:
Thanks people.
Is there any problem with spaces in Lucene? :?:
Thanks people.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2006 07:20 AM
If the search term contains spaces you can quote it:
Kevin
@\{http\://www.alfresco.org/model/content/1.0\}name:'Test Folder"
Thanks,Kevin

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2006 07:43 AM
Thanks Kevin :wink:
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2007 08:49 AM
Hi
I use following query to search content for their TITLE as well as TEXT in the document. But this returns result only contents and files with the specified TITLE, it ignores TEXT search.
Is anything wrong with my query?
StringBuffer sb = new StringBuffer();
sb.append("TYPE:\"{").append(NamespaceService.CONTENT_MODEL_1_0_URI).append("}content\" ") ;
sb.append("+@").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:title:"test" TEXT:"test");
Query query = new Query(Constants.QUERY_LANG_LUCENE, sb.toString());
Thanks
Bindiya
I use following query to search content for their TITLE as well as TEXT in the document. But this returns result only contents and files with the specified TITLE, it ignores TEXT search.
Is anything wrong with my query?
StringBuffer sb = new StringBuffer();
sb.append("TYPE:\"{").append(NamespaceService.CONTENT_MODEL_1_0_URI).append("}content\" ") ;
sb.append("+@").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:title:"test" TEXT:"test");
Query query = new Query(Constants.QUERY_LANG_LUCENE, sb.toString());
Thanks
Bindiya
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2008 05:28 AM
Hi Bindiya,
You can use the following query to search content for their NAME as well as TEXT in a document :
Regards,
CyrielleB
You can use the following query to search content for their NAME as well as TEXT in a document :
String docId = "99.xml";String text = "textToSearch";String queryString = "@cm\\:name:\"" + docId + "\" AND TEXT:\""+text+" \"";Query query = new Query(Constants.QUERY_LANG_LUCENE, queryString);
Regards,
CyrielleB
