Last active
November 27, 2015 18:29
-
-
Save joshdcollins/0e3f24dd23c3fc6ac8e3 to your computer and use it in GitHub Desktop.
SOLR Query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" /> | |
<field name="_version_" type="long" indexed="true" stored="true"/> | |
<field name="_root_" type="string" indexed="true" stored="false"/> | |
<field name="_text_" type="text_autophrase" indexed="true" stored="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/> | |
<field name="content" type="text_autophrase" indexed="true" stored="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/> | |
<field name="entity_name" type="text_autophrase" indexed="true" stored="true" multiValued="false" termVectors="true" termPositions="true" termOffsets="true"/> | |
<field name="entity_type" type="text_general" indexed="true" stored="true" multiValued="false" termVectors="true" termPositions="true" termOffsets="true"/> | |
<field name="entity_date" type="tdate" indexed="true" stored="true" multiValued="false"/> | |
<field name="entity_sort" type="int" indexed="true" stored="true" multiValued="false"/> | |
<field name="entity_author" type="text_general" indexed="true" stored="true" multiValued="false"/> | |
<field name="content_exact" type="text_autophrase_exact" indexed="true" stored="false" multiValued="true"/> | |
<field name="entity_name_exact" type="text_autophrase_exact" indexed="true" stored="false" multiValued="false"/> | |
<copyField source="*" dest="_text_"/> | |
<copyField source="entity_name" dest="entity_name_exact"/> | |
<copyField source="content" dest="content_exact"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<fieldType name="text_autophrase" class="solr.TextField" positionIncrementGap="100"> | |
<analyzer type="index"> | |
<tokenizer class="solr.WhitespaceTokenizerFactory" /> | |
<filter class="solr.LowerCaseFilterFactory" /> | |
<filter class="org.apache.lucene.analysis.autophrase.AutoPhrasingTokenFilterFactory" phrases="autophrases.txt" includeTokens="true" replaceWhitespaceWith="_" /> | |
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /> | |
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true" /> | |
<filter class="solr.NGramFilterFactory" minGramSize="3" maxGramSize="6"/> | |
</analyzer> | |
<analyzer type="query"> | |
<tokenizer class="solr.WhitespaceTokenizerFactory" /> | |
<filter class="solr.LowerCaseFilterFactory" /> | |
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /> | |
</analyzer> | |
</fieldType> | |
<fieldType name="text_autophrase_exact" class="solr.TextField" positionIncrementGap="100"> | |
<analyzer type="index"> | |
<tokenizer class="solr.WhitespaceTokenizerFactory" /> | |
<filter class="solr.LowerCaseFilterFactory" /> | |
<filter class="org.apache.lucene.analysis.autophrase.AutoPhrasingTokenFilterFactory" phrases="autophrases.txt" includeTokens="true" replaceWhitespaceWith="_" /> | |
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /> | |
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true" /> | |
</analyzer> | |
<analyzer type="query"> | |
<tokenizer class="solr.WhitespaceTokenizerFactory" /> | |
<filter class="solr.LowerCaseFilterFactory" /> | |
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /> | |
</analyzer> | |
</fieldType> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SEARCH_URL_PREFIX = "http://localhost:8983/solr/rms_core_dev/autophrase?q=" | |
var URL = SEARCH_URL_PREFIX + searchTerm + | |
"&q.op=AND | |
&wt=json | |
&defType=dismax | |
&qf=entity_name_exact^10000.0 content_exact^5000.0 entity_name^1000.0 content^500 entity_author | |
&pf=entity_name_exact entity_name content content_exact | |
&bq=(entity_type:company^10000 OR entity_type:insight^7500) | |
&rows=100 | |
&fl=*,score | |
&hl=true | |
&hl.useFastVectorHighlighter=true | |
&hl.q=" + searchTerm + " | |
&hl.fl=entity_name content | |
&hl.bs.maxScan=15 | |
&hl.snippets=1000 | |
&hl.fragsize=50000 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My general objective is:
A few questions: