Any idea why this Lucene search returns nothing?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2007 04:18 PM
I'm new to Alfresco and Lucene. I gave http://lucene.apache.org/java/docs/queryparsersyntax.html a read through but I don't see anything obvious of why this isn't returning anything.
I'm modifying the Query1.java example for the Web Service.
I've created the Query of
but it's returning with "No query results found."
If I run the (almost) default query the example came with
one of the results is "row 1: {http://www.alfresco.org/model/content/1.0}path = /{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1...." which is what I'm trying to mimic with my query. Essentially get me everything in that path. Can anyone see what's wrong with my query?
I'm modifying the Query1.java example for the Web Service.
I've created the Query of
Query query = new Query(Constants.QUERY_LANG_LUCENE, "path:'/app:company_home/cm:" +ISO9075.encode("Pathology Reports")+"/*'");
but it's returning with "No query results found."
If I run the (almost) default query the example came with
Query query = new Query(Constants.QUERY_LANG_LUCENE, "TEXT:'pathology'");
one of the results is "row 1: {http://www.alfresco.org/model/content/1.0}path = /{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1...." which is what I'm trying to mimic with my query. Essentially get me everything in that path. Can anyone see what's wrong with my query?
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2007 04:50 PM
Hi,
Here is the query
Query query = new Query(Constants.QUERY_LANG_LUCENE, "PATH:\"/app:company_home/cm:" +ISO9075.encode("Pathology Reports")+"/*\"");
You need the escape the " in your code like above.
Below link should provide you with more information on Search
http://wiki.alfresco.com/wiki/Search#Path_Queries
Best Regards,
Shagul Khaja,
Here is the query
Query query = new Query(Constants.QUERY_LANG_LUCENE, "PATH:\"/app:company_home/cm:" +ISO9075.encode("Pathology Reports")+"/*\"");
You need the escape the " in your code like above.
Below link should provide you with more information on Search
http://wiki.alfresco.com/wiki/Search#Path_Queries
Best Regards,
Shagul Khaja,

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2007 04:53 PM
Hi,
Here is the query
Query query = new Query(Constants.QUERY_LANG_LUCENE, "PATH:"/app:company_home/cm:" +ISO9075.encode("Pathology Reports")+"/*"");
You need the escape the " in your code like above.
Below link should provide you with more information on Search
http://wiki.alfresco.com/wiki/Search#Path_Queries
Best Regards,
Shagul Khaja,
Great, it worked. Thank you. I tried a mix of " vs ' but I guess not that one.
