Skip to content

Commit

Permalink
Updated schema.xml with new stemmer and better similarity comparator.…
Browse files Browse the repository at this point in the history
… Only sort results by last_action_date when there is no query
  • Loading branch information
Eric van Zanten committed Jan 12, 2016
1 parent 467a37f commit dfb3029
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 23 deletions.
3 changes: 1 addition & 2 deletions councilmatic/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
sqs = SearchQuerySet().facet('bill_type')\
.facet('sponsorships', sort='index')\
.facet('controlling_body')\
.facet('inferred_status')\
.order_by('-last_action_date')
.facet('inferred_status')

urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
Expand Down
49 changes: 28 additions & 21 deletions solr_scripts/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<filter class="solr.EnglishMinimalStemFilterFactory"/>
<!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
<filter class="solr.EnglishMinimalStemFilterFactory"/>
<filter class="solr.PorterStemFilterFactory"/>
-->
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
Expand All @@ -92,10 +92,10 @@
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<filter class="solr.EnglishMinimalStemFilterFactory"/>
<!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
<filter class="solr.EnglishMinimalStemFilterFactory"/>
<filter class="solr.PorterStemFilterFactory"/>
-->
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
</fieldType>

Expand Down Expand Up @@ -151,45 +151,51 @@
<dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false"/>


<field name="bill_type_exact" type="string" indexed="true" stored="true" multiValued="false" />
<field name="identifier" type="text_en" indexed="true" stored="true" multiValued="false" />

<field name="slug" type="string" indexed="false" stored="true" multiValued="false" />

<field name="sponsorships" type="text_en" indexed="true" stored="true" multiValued="true" />

<field name="full_text" type="text_en" indexed="true" stored="true" multiValued="false" />

<field name="inferred_status_exact" type="string" indexed="true" stored="true" multiValued="false" />

<field name="inferred_status" type="text_en" indexed="true" stored="true" multiValued="false" />

<field name="actions" type="text_en" indexed="true" stored="true" multiValued="true" />
<field name="text" type="text_en" indexed="true" stored="true" multiValued="false" />

<field name="controlling_body_exact" type="string" indexed="true" stored="true" multiValued="true" />

<field name="slug" type="string" indexed="false" stored="true" multiValued="false" />

<field name="abstract" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="inferred_status" type="text_en" indexed="true" stored="true" multiValued="false" />

<field name="text" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="source_url" type="string" indexed="false" stored="true" multiValued="false" />

<field name="controlling_body" type="text_en" indexed="true" stored="true" multiValued="true" />
<field name="source_note" type="text_en" indexed="true" stored="true" multiValued="false" />

<field name="source_url" type="string" indexed="false" stored="true" multiValued="false" />
<field name="bill_type_exact" type="string" indexed="true" stored="true" multiValued="false" />

<field name="ocd_id" type="string" indexed="false" stored="true" multiValued="false" />

<field name="friendly_name" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="ocr_full_text" type="text_en" indexed="true" stored="true" multiValued="false" />

<field name="identifier" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="bill_type" type="text_en" indexed="true" stored="true" multiValued="false" />

<field name="last_action_date" type="date" indexed="true" stored="true" multiValued="false" />

<field name="description" type="text_en" indexed="true" stored="true" multiValued="false" />

<field name="sponsorships_exact" type="string" indexed="true" stored="true" multiValued="true" />

<field name="last_action_date" type="date" indexed="true" stored="true" multiValued="false" />
<field name="inferred_status_exact" type="string" indexed="true" stored="true" multiValued="false" />

<field name="source_note" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="legislative_session_exact" type="string" indexed="true" stored="true" multiValued="false" />

<field name="bill_type" type="text_en" indexed="true" stored="true" multiValued="false" />
<field name="actions" type="text_en" indexed="true" stored="true" multiValued="true" />

<field name="controlling_body" type="text_en" indexed="true" stored="true" multiValued="true" />

<field name="abstract" type="text_en" indexed="true" stored="true" multiValued="false" />

<field name="legislative_session" type="text_en" indexed="true" stored="true" multiValued="false" />

<field name="friendly_name" type="text_en" indexed="true" stored="true" multiValued="false" />

</fields>

Expand All @@ -201,5 +207,6 @@

<!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
<solrQueryParser defaultOperator="AND"/>
<similarity class="solr.BM25SimilarityFactory"/>
</schema>

0 comments on commit dfb3029

Please sign in to comment.