This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 466f2be2c443ccf1311ec926efb6c9f244e1f99c
Author: juanpablo <[email protected]>
AuthorDate: Tue Mar 17 22:41:11 2020 +0100

    o.a.w.search classes don't need to extend their counterparts from 
o.a.w.api.search
---
 .../main/java/org/apache/wiki/search/QueryItem.java    | 18 +++++++++++++++++-
 .../main/java/org/apache/wiki/search/SearchResult.java | 17 ++++++++++++++++-
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git 
a/jspwiki-210-adapters/src/main/java/org/apache/wiki/search/QueryItem.java 
b/jspwiki-210-adapters/src/main/java/org/apache/wiki/search/QueryItem.java
index 54b6dd7..280c546 100644
--- a/jspwiki-210-adapters/src/main/java/org/apache/wiki/search/QueryItem.java
+++ b/jspwiki-210-adapters/src/main/java/org/apache/wiki/search/QueryItem.java
@@ -26,5 +26,21 @@ package org.apache.wiki.search;
  * @see org.apache.wiki.api.search.QueryItem
  */
 @Deprecated
-public class QueryItem extends org.apache.wiki.api.search.QueryItem {
+public class QueryItem {
+
+    /** The word is required to be in the pages */
+    public static final int REQUIRED  = 1;
+
+    /** The word may NOT be in the pages */
+    public static final int FORBIDDEN = -1;
+
+    /** The word should be in the pages, but the search engine may use its own 
discretion. */
+    public static final int REQUESTED = 0;
+
+    /** The word that is being searched */
+    public String word;
+
+    /** The type of the word.  See above for types.  The default is REQUESTED. 
*/
+    public int type = REQUESTED;
+
 }
diff --git 
a/jspwiki-210-adapters/src/main/java/org/apache/wiki/search/SearchResult.java 
b/jspwiki-210-adapters/src/main/java/org/apache/wiki/search/SearchResult.java
index dbb93ce..ae677a9 100644
--- 
a/jspwiki-210-adapters/src/main/java/org/apache/wiki/search/SearchResult.java
+++ 
b/jspwiki-210-adapters/src/main/java/org/apache/wiki/search/SearchResult.java
@@ -28,7 +28,7 @@ import org.apache.wiki.WikiPage;
  * @see org.apache.wiki.api.search.SearchResult
  */
 @Deprecated
-public interface SearchResult extends org.apache.wiki.api.search.SearchResult {
+public interface SearchResult {
     
        /**
      *  Return the page.
@@ -37,4 +37,19 @@ public interface SearchResult extends 
org.apache.wiki.api.search.SearchResult {
      */
     WikiPage getPage();
 
+    /**
+     *  Returns the score.
+     *
+     *  @return A positive score value.  Note that there is no upper limit for 
the score.
+     */
+    int getScore();
+
+    /**
+     * Collection of XHTML fragments representing some contexts in which the 
match was made (a.k.a., "snippets").
+     *
+     * @return the search results
+     * @since 2.4
+     */
+    String[] getContexts();
+
 }

Reply via email to