Skip to Content.
Sympa Menu

idok-commit - [idok-commit] idok commit r284 - trunk/sites/psi/java/ch/psi/idok/gwt/twiki/client

idok-commit AT lists.psi.ch

Subject: Commit emails of the iDok project

List archive

[idok-commit] idok commit r284 - trunk/sites/psi/java/ch/psi/idok/gwt/twiki/client


Chronological Thread 
  • From: "AFS account Roman Geus" <geus AT savannah.psi.ch>
  • To: idok-commit AT lists.psi.ch
  • Subject: [idok-commit] idok commit r284 - trunk/sites/psi/java/ch/psi/idok/gwt/twiki/client
  • Date: Mon, 20 Oct 2008 15:35:23 +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: geus
Date: Mon Oct 20 15:35:22 2008
New Revision: 284

Log:
Disabled quoting of special characters like +-&|!(){}[]^\"~*?:\
inTwikiToLuceneConverter.java to allow maximum flexibility in query strings


Modified:

trunk/sites/psi/java/ch/psi/idok/gwt/twiki/client/TwikiToLuceneConverter.java

Modified:
trunk/sites/psi/java/ch/psi/idok/gwt/twiki/client/TwikiToLuceneConverter.java
==============================================================================
---
trunk/sites/psi/java/ch/psi/idok/gwt/twiki/client/TwikiToLuceneConverter.java
(original)
+++
trunk/sites/psi/java/ch/psi/idok/gwt/twiki/client/TwikiToLuceneConverter.java
Mon Oct 20 15:35:22 2008
@@ -2,26 +2,26 @@

/**
* Convert TWiki query string to an equivalent Lucene query string
- *
+ *
* @see ch.psi.idok.gwt.twiki.junit.TwikiToLuceneConverterTest
*/
public class TwikiToLuceneConverter {
-
+
/**
* TWiki input query string
*/
private String twikiQuery;
-
+
/**
* Current position in the input query string
*/
private int index;
-
+
/**
* Current query string term
*/
private String currentTerm;
-
+
/**
* true if currentTerm is an exclude term
*/
@@ -119,6 +119,10 @@
/**
* Quote special characters of Lucene query term
*
+ * Currently only spaces are quoted. Other special characters of the
Lucene
+ * query term need to be quoted manually, to allow maximum flexibility in
+ * search terms.
+ *
* @param term
* the term to be quoted
* @return the term with special characters quoted
@@ -126,7 +130,7 @@
private static String quote(String term) {
StringBuffer buf = new StringBuffer();
for (char ch : term.toCharArray()) {
- if (" +-&|!(){}[]^\"~*?:\\".indexOf(ch) != -1)
+ if (" ".indexOf(ch) != -1)
buf.append('\\');
buf.append(ch);
}



  • [idok-commit] idok commit r284 - trunk/sites/psi/java/ch/psi/idok/gwt/twiki/client, AFS account Roman Geus, 10/20/2008

Archive powered by MHonArc 2.6.19.

Top of Page