Changeset 26360


Ignore:
Timestamp:
2012-10-19T18:50:46+13:00 (12 years ago)
Author:
ak19
Message:

Searching on all fields has changed. Previously searching over all fields was to be specified without any index field prefixed to the query. Now, searching over all fields requires the foxml.all.text index field to be prefixed to the query.

Location:
other-projects/gs3-webservices-java-client/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • other-projects/gs3-webservices-java-client/trunk/src/GS3Fedora/org/greenstone/fedora/services/FedoraGS3Connection.java

    r26309 r26360  
    21892189        // Params to search() method below: string of fielded query terms; 
    21902190        // hitpageStart, hitpageEnd, snippetsMax (leave that 0)
    2191         query = query + " " + "PID" + COLON + GREENSTONE;
     2191        query = GSearchConnection.ALL_INDEXED_FIELDS + COLON + query + " " + "PID" + COLON + GREENSTONE;
    21922192       
    21932193        String searchResult = this.fedoraGSearch.search(query, 1, maxDocs, 0);
  • other-projects/gs3-webservices-java-client/trunk/src/GS3Fedora/org/greenstone/fedora/services/GSearchConnection.java

    r26309 r26360  
    7474    protected static final String DC_TITLE_FIELD = "dc.title";
    7575    protected static final String FULLTEXT_FIELD = "ds.fulltext";
     76    public static final String ALL_INDEXED_FIELDS = "foxml.all.text";
    7677   
    7778    /** separator used internally to separate values of a search field */
     
    291292        // and put quotes around phrases, then combine all the terms
    292293        // together again with spaces to separate them.
    293         allfields = formatSearchTermsInField(allfields, ALL_FIELDS); // search foxml.all.text
     294        allfields = formatSearchTermsInField(allfields, ALL_FIELDS); // searches foxml.all.text
    294295            // ALL_FIELDS has no field name
    295296        titles = formatSearchTermsInField(titles, DC_TITLE_FIELD);
     
    349350            if(!fieldName.equals(ALL_FIELDS)) {
    350351                field = fieldName + ":" + field;
     352            }
     353            // in older versions of GSearch (version 2.2), searching over all fields
     354            // meant not specifying an index to search in. From GSearch version 2.4/2.5
     355            // need to search in field "foxml.all.text" to search all indexed fields.
     356            else {
     357                field = ALL_INDEXED_FIELDS + ":" + field; //searches in foxml.all.text
    351358            }
    352359           
Note: See TracChangeset for help on using the changeset viewer.