Alfresco 2.0 Query for document properties
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2007 07:44 AM
Hi all,
I have trouble to use query for searching document.
I'm using this…
Query query = new Query(Constants.QUERY_LANG_LUCENE, "+@\\{http\\://www.alfresco.org/model/content/1.0\\}title:\'my_title\"");
and it works fine but when I want to use WildCard search like this…
Query query = new Query(Constants.QUERY_LANG_LUCENE, "+@\\{http\\://www.alfresco.org/model/content/1.0\\}title:\'my_tit*\"");
it does not work. I will get response that document was not found. Is it problem of syntax, luciene or alfresco engine?
thanx
I have trouble to use query for searching document.
I'm using this…
Query query = new Query(Constants.QUERY_LANG_LUCENE, "+@\\{http\\://www.alfresco.org/model/content/1.0\\}title:\'my_title\"");
and it works fine but when I want to use WildCard search like this…
Query query = new Query(Constants.QUERY_LANG_LUCENE, "+@\\{http\\://www.alfresco.org/model/content/1.0\\}title:\'my_tit*\"");
it does not work. I will get response that document was not found. Is it problem of syntax, luciene or alfresco engine?
thanx
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2007 06:04 AM
Hello, at first you can try to remove the " before and after your value. If this does not find your document, you can try to remove the + befor your search argument. Something like this:
Query query = new Query(Constants.QUERY_LANG_LUCENE, "@\\{http\\://www.alfresco.org/model/content/1.0\\}title:my_tit*");
This page may help you:
http://wiki.alfresco.com/wiki/Search#Finding_nodes_by_text_property_values
Query query = new Query(Constants.QUERY_LANG_LUCENE, "@\\{http\\://www.alfresco.org/model/content/1.0\\}title:my_tit*");
This page may help you:
http://wiki.alfresco.com/wiki/Search#Finding_nodes_by_text_property_values

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2007 10:00 AM
Hi
Wild cards in phrase queries are now supported. So your second example will work with the latest code.
For 2.0, in the second search example, the best you can do is tokenise the search yourself.
Query query = new Query(Constants.QUERY_LANG_LUCENE, "+@\\{http\\://www.alfresco.org/model/content/1.0\\}title:my \\{http\\://www.alfresco.org/model/content/1.0\\}title:tit*");
The down side is that the words could be in any order.
Andy
Wild cards in phrase queries are now supported. So your second example will work with the latest code.
For 2.0, in the second search example, the best you can do is tokenise the search yourself.
Query query = new Query(Constants.QUERY_LANG_LUCENE, "+@\\{http\\://www.alfresco.org/model/content/1.0\\}title:my \\{http\\://www.alfresco.org/model/content/1.0\\}title:tit*");
The down side is that the words could be in any order.
Andy
