Skip to Content.
Sympa Menu

idok-commit - [idok-commit] idok commit r364 - trunk/java/ch/idok/service/server/search/rest

idok-commit AT lists.psi.ch

Subject: Commit emails of the iDok project

List archive

[idok-commit] idok commit r364 - trunk/java/ch/idok/service/server/search/rest


Chronological Thread 
  • From: "AFS account Florian Huebner" <huebner AT savannah.psi.ch>
  • To: idok-commit AT lists.psi.ch
  • Subject: [idok-commit] idok commit r364 - trunk/java/ch/idok/service/server/search/rest
  • Date: Thu, 14 May 2009 10:54:32 +0200
  • List-archive: <https://lists.web.psi.ch/pipermail/idok-commit/>
  • List-id: Commit emails of the iDok project <idok-commit.lists.psi.ch>

Author: huebner
Date: Thu May 14 10:54:32 2009
New Revision: 364

Log:
Fixed Bug #IDO-201:REST Search within folder gives no hits

Modified:

trunk/java/ch/idok/service/server/search/rest/RestSearchServiceResource.java

Modified:
trunk/java/ch/idok/service/server/search/rest/RestSearchServiceResource.java
==============================================================================
---
trunk/java/ch/idok/service/server/search/rest/RestSearchServiceResource.java
(original)
+++
trunk/java/ch/idok/service/server/search/rest/RestSearchServiceResource.java
Thu May 14 10:54:32 2009
@@ -172,7 +172,7 @@
if (sa.length > 2)
folder = sa[2];

- // parse and validate query parameters
+ // parse and validate query parameters
if (query == null)
return Response.status(Status.BAD_REQUEST).entity(
"empty query string").build();
@@ -227,10 +227,23 @@
if (folder == null) {
luceneQuery = String.format("%s/%s::%s", project,
repository, query);
+ //e.g: ait/intern::geus
} else {
- luceneQuery = String.format(
- "%s/%s::auto\\:relpath:%s/* AND (%s)", project,
- repository, folder, query);
+ String result = "";
+ String[] folderArray = folder.split("/");
+ if (folderArray.length > 1){
+ result = "auto\\:relpath:"+folderArray[0];
+ for(int i = 1; i < folderArray.length; i++){
+ result += " AND
auto\\:relpath:"+folderArray[i];
+ }
+ }else
+ result = "auto\\:relpath:"+folder;
+
+ luceneQuery = String.format(
+ "%s/%s::(%s) AND (%s)", project,
+ repository, result, query);
+ //e.g: ait/intern::(auto\\:relpath:Events AND
auto\\:relpath:ProgrammMeetings) AND (geus)
+ //for a search in
https://dms02.psi.ch/api/v1/search/ait/intern/Events/ProgrammMeetings/
}

}



  • [idok-commit] idok commit r364 - trunk/java/ch/idok/service/server/search/rest, AFS account Florian Huebner, 05/14/2009

Archive powered by MHonArc 2.6.19.

Top of Page