Changeset 6284


Ignore:
Timestamp:
06/05/15 15:05:33 (9 years ago)
Author:
Twan Goosen
Message:

Reintegrated vlo-ticket761 feature branch
Fixes #761

Location:
vlo/trunk
Files:
13 edited
1 copied

Legend:

Unmodified
Added
Removed
  • vlo/trunk

  • vlo/trunk/UPGRADE.txt

  • vlo/trunk/vlo-commons/src/main/resources/VloConfig.xml

    r6274 r6284  
    129129        <technicalField>_lastSeen</technicalField>
    130130        <technicalField>_componentProfile</technicalField>
     131        <technicalField>_hierarchyWeight</technicalField>
     132        <technicalField>_hasPart</technicalField>
     133        <technicalField>_isPartOf</technicalField>
    131134    </technicalFields>
    132135   
     
    160163   
    161164    <!-- makes the score for the result ranking visible in the search results -->
    162     <showResultScores>false</showResultScores>
     165    <showResultScores>true</showResultScores>
    163166</VloConfig>
  • vlo/trunk/vlo-commons/src/test/java/eu/clarin/cmdi/vlo/config/DefaultVloConfigFactoryTest.java

    r6274 r6284  
    928928    public void testGetTechnicalFields() {
    929929        Set<String> result = config.getTechnicalFields();
    930         assertEquals(9, result.size());
     930        assertEquals(12, result.size());
    931931    }
    932932
  • vlo/trunk/vlo-solr/src/main/solr_conf/solr/collection1/conf/schema.xml

    r6212 r6284  
    416416   <field name="id" type="string" indexed="true" stored="true" required="true"/>
    417417   <field name="collection" type="string" indexed="true" stored="true" multiValued="true" />
    418    <field name="name" type="string" indexed="true" stored="true" multiValued="false"/>
     418   <field name="name" type="text" indexed="true" stored="true" multiValued="false"/>
    419419   <field name="projectName" type="string" indexed="true" stored="true" multiValued="true"/>
    420420   <field name="continent" type="string" indexed="true" stored="true" multiValued="true"/>
  • vlo/trunk/vlo-solr/src/main/solr_conf/solr/collection1/conf/solrconfig.xml

    r5915 r6284  
    135135    </listener>
    136136    -->
    137 
     137    <updateLog/>
    138138  </updateHandler>
    139139 
     
    363363    <!-- default values for query parameters -->
    364364     <lst name="defaults">
    365        <str name="echoParams">explicit</str>
    366        <!--
    367        <int name="rows">10</int>
    368        <str name="fl">*</str>
    369        <str name="version">2.1</str>
    370         -->
     365        <str name="echoParams">explicit</str>
     366       
     367        <!-- See https://wiki.apache.org/solr/DisMaxQParserPlugin -->
     368        <str name="defType">dismax</str>
     369       
     370        <!-- 'Fetch all documents' query -->
     371        <str name="q.alt">*:*</str>
     372       
     373        <!-- Query fields -->
     374        <str name="qf">
     375            <!-- TODO: Add _languagename field for search purposes? -->
     376           name^8 description^4 keywords^2 languageCode^2 country^2 organisation^2 subject^2 collection^1 modality^1 genre^1 continent^.5 id^.1
     377        </str>
     378       
     379        <!-- Phrase fields (boost if phrase is matched) -->
     380        <str name="pf">
     381            name^2 description
     382        </str>
     383       
     384        <!-- Boost fields (boost based on field value regardless of query) -->
     385        <str name="bf">
     386            <!-- boost by hierarchy weight (reverse order because lower numbers indicate a higher level -->
     387            rord(_hierarchyWeight)
     388           <!-- TODO: use bf to boost records with one or more resources? -->
     389        </str>
     390       
     391          <!--
     392          <int name="rows">10</int>
     393          <str name="fl">*</str>
     394          <str name="version">2.1</str>
     395           -->
    371396     </lst>
    372397  </requestHandler>
     
    905930    <queryResponseWriter name="phps" class="org.apache.solr.request.PHPSerializedResponseWriter"/>
    906931
    907     <queryResponseWriter name="custom" class="com.example.MyResponseWriter"/>
    908   -->
    909 
    910   <!-- XSLT response writer transforms the XML output by any xslt file found
    911        in Solr's conf/xslt directory.  Changes to xslt files are checked for
    912        every xsltCacheLifetimeSeconds. 
    913    -->
    914   <queryResponseWriter name="xslt" class="org.apache.solr.response.XSLTResponseWriter">
    915     <int name="xsltCacheLifetimeSeconds">5</int>
    916   </queryResponseWriter>
    917 
    918 
    919   <!-- example of registering a query parser
    920   <queryParser name="lucene" class="org.apache.solr.search.LuceneQParserPlugin"/>
    921   -->
    922 
    923   <!-- example of registering a custom function parser
    924   <valueSourceParser name="myfunc" class="com.mycompany.MyValueSourceParser" />
    925   -->
    926 
    927   <!-- config for the admin interface -->
    928   <admin>
    929     <defaultQuery>solr</defaultQuery>
    930 
    931     <!-- configure a healthcheck file for servers behind a loadbalancer
    932     <healthcheck type="file">server-enabled</healthcheck>
    933     -->
    934   </admin>
     932      <queryResponseWriter name="custom" class="com.example.MyResponseWriter"/>
     933    -->
     934
     935    <!-- XSLT response writer transforms the XML output by any xslt file found
     936        in Solr's conf/xslt directory.  Changes to xslt files are checked for
     937        every xsltCacheLifetimeSeconds. 
     938    -->
     939    <queryResponseWriter name="xslt" class="org.apache.solr.response.XSLTResponseWriter">
     940        <int name="xsltCacheLifetimeSeconds">5</int>
     941    </queryResponseWriter>
     942
     943
     944    <!-- example of registering a query parser
     945    <queryParser name="lucene" class="org.apache.solr.search.LuceneQParserPlugin"/>
     946    -->
     947
     948    <!-- example of registering a custom function parser
     949    <valueSourceParser name="myfunc" class="com.mycompany.MyValueSourceParser" />
     950    -->
     951
     952    <!-- config for the admin interface -->
     953    <admin>
     954        <defaultQuery>solr</defaultQuery>
     955
     956        <!-- configure a healthcheck file for servers behind a loadbalancer
     957        <healthcheck type="file">server-enabled</healthcheck>
     958        -->
     959    </admin>
    935960
    936961</config>
  • vlo/trunk/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/config/VloSolrSpringConfig.java

    r6232 r6284  
    119119            FacetConstants.FIELD_CLARIN_PROFILE,
    120120            FacetConstants.FIELD_COMPLETE_METADATA,
     121            FacetConstants.FIELD_HIERARCHY_WEIGHT,
     122            FacetConstants.FIELD_HAS_PART,
     123            FacetConstants.FIELD_IS_PART_OF,
    121124            FacetConstants.FIELD_SOLR_SCORE
    122125    );
  • vlo/trunk/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/solr/impl/AbstractSolrQueryFactory.java

    r5202 r6284  
    3232public abstract class AbstractSolrQueryFactory {
    3333
    34     protected static final String SOLR_SEARCH_ALL = "*:*";
     34    protected static final String SOLR_SEARCH_ALL = null;
    3535
    3636    protected final void addQueryFacetParameters(final SolrQuery query, QueryFacetsSelection queryFacetsSelections) {
     
    4040        } else {
    4141            // escape query content and wrap in quotes to make literal query
    42             query.setQuery("\"" + ClientUtils.escapeQueryChars(queryString) + "\"");
     42            query.setQuery(queryString);
    4343        }
    4444        final Map<String, FacetSelection> selections = queryFacetsSelections.getSelection();
  • vlo/trunk/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/solr/impl/SolrDocumentQueryFactoryImpl.java

    r6190 r6284  
    4242        defaultQueryTemplate = new SolrQuery();
    4343        defaultQueryTemplate.setFields(documentFields.toArray(new String[]{}));
     44//        //TODO: qf (all fields with weights - make configurable (later)
     45//        defaultQueryTemplate.setParam(DisMaxParams.QF, "name^20 description^10");
    4446    }
    4547
  • vlo/trunk/vlo-web-app/src/test/java/eu/clarin/cmdi/vlo/service/solr/impl/SearchResultsDaoImplTest.java

    r4972 r6284  
    105105        query.setStart(0);
    106106        query.setFields(FIELD_NAME, FIELD_ID, FIELD_DESCRIPTION);
    107         query.setQuery("*:*");
     107        query.setQuery(null);
    108108
    109109        query.setFacet(true);
     
    133133        query.setStart(0);
    134134        query.setFields(FIELD_NAME, FIELD_ID, FIELD_DESCRIPTION);
    135         query.setQuery("*:*");
    136135        {
    137136            // all documents should match this
  • vlo/trunk/vlo-web-app/src/test/java/eu/clarin/cmdi/vlo/service/solr/impl/SolrDocumentQueryFactoryImplTest.java

    r5202 r6284  
    6666        assertTrue(fields.contains("field2"));
    6767        assertTrue(fields.contains("field3"));
    68         assertEquals("\"query\"", query.getQuery());
     68        assertEquals("query", query.getQuery());
    6969    }
    7070
  • vlo/trunk/vlo-web-app/src/test/java/eu/clarin/cmdi/vlo/service/solr/impl/SolrFacetQueryFactoryImplTest.java

    r4963 r6284  
    5858
    5959        // default: query selects all values
    60         assertEquals("*:*", query.getQuery());
     60        assertNull(query.getQuery());
    6161
    6262        // no selection -> no filter queries
     
    8282
    8383        // default: query selects all values
    84         assertEquals("*:*", query.getQuery());
     84        assertNull(query.getQuery());
    8585
    8686        // Only empty selections -> no filter queries
     
    107107
    108108        // default: query selects all values
    109         assertEquals("*:*", query.getQuery());
     109        assertNull(query.getQuery());
    110110
    111111        // Expecting three filter queries as three values have been selected in total
     
    133133
    134134        assertEquals(1, query.getFilterQueries().length);
    135         assertEquals("\"query\\ string\"", query.getQuery()); //space should be escaped, and query wrapped!
     135        assertEquals("query string", query.getQuery());
    136136
    137137        // Expecting three filter queries as three values have been selected in total
  • vlo/trunk/vlo-web-app/src/test/resources/solr/collection1/conf/solrconfig.xml

    r5916 r6284  
    7272       If replication is in use, this should match the replication configuration. -->
    7373<!--   <dataDir></dataDir>-->
    74 
     74       
    7575  <!--  Enables JMX if and only if an existing MBeanServer is found, use this
    7676    if you want to configure JMX through JVM parameters. Remove this to disable
     
    359359     <lst name="defaults">
    360360       <str name="echoParams">explicit</str>
     361     <str name="defType">edismax</str>
     362     <str name="q.alt">*:*</str>
    361363       <!--
    362364       <int name="rows">10</int>
     
    401403     <str name="echoParams">explicit</str>
    402404     <float name="tie">0.01</float>
    403      <str name="qf">
     405<!--     <str name="qf">
    404406        text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
     407     </str>-->
     408     <str name="pf">
     409        name^4 description^2
    405410     </str>
    406      <str name="pf">
    407         text^0.2 features^1.1 name^1.5 manu^1.4 manu_exact^1.9
    408      </str>
     411     <!--
    409412     <str name="bf">
    410413        popularity^0.5 recip(price,1,1000,1000)^0.3
     
    416419        2&lt;-1 5&lt;-2 6&lt;90%
    417420     </str>
    418      <int name="ps">100</int>
     421     <int name="ps">100</int>-->
    419422     <str name="q.alt">*:*</str>
    420      <!-- example highlighter config, enable per-query with hl=true -->
     423<!--      example highlighter config, enable per-query with hl=true
    421424     <str name="hl.fl">text features name</str>
    422      <!-- for this field, we want no fragmenting, just highlighting -->
     425      for this field, we want no fragmenting, just highlighting
    423426     <str name="f.name.hl.fragsize">0</str>
    424      <!-- instructs Solr to return the field itself if no query terms are
    425           found -->
     427      instructs Solr to return the field itself if no query terms are
     428          found
    426429     <str name="f.name.hl.alternateField">name</str>
    427      <str name="f.text.hl.fragmenter">regex</str> <!-- defined below -->
     430     <str name="f.text.hl.fragmenter">regex</str> defined below -->
    428431    </lst>
    429432  </requestHandler>
     
    907910       every xsltCacheLifetimeSeconds. 
    908911   -->
    909 <!--  <queryResponseWriter name="xslt" class="org.apache.solr.response.XSLTResponseWriter">
     912  <queryResponseWriter name="xslt" class="org.apache.solr.response.XSLTResponseWriter">
    910913    <int name="xsltCacheLifetimeSeconds">5</int>
    911   </queryResponseWriter>-->
     914  </queryResponseWriter>
    912915
    913916
Note: See TracChangeset for help on using the changeset viewer.