<commit_before>Dice Relevancy Feedback
========================

Dice.com's solr plugins for performing personalized search, and recommendations (via the relevancy feedback plugin) and conceptual / semantic search (via the unsupervised feedback plugin).

## Building the Plugin
A pre-built jar file can be found in the ```./target``` folder. The project contains a maven pom.xml file which can also be used to build it from source.

## Supported Solr versions
Current branch is compiled for Solr 5.4. I will be adding branches compiled against Solr 6 versions shortly. If there is a particular version of Solr you need this for, please create a GitHub issue and I'll see what I can do.
To manually compile it for a later version, use maven to compile the plugins using the pom.xml file, and update the versions of the jars in that file. Then fix any build errors. Later versions of solr (6.x) use query builders to build the boolean queries, which is likely what needs to be fixed to support 6.x.
 
## Importing into SOLR
Please see the official SOLR guidelines for registering plugins with solr. This basically involves simply dropping the jar file into one of the folders that Solr checks for class and jar files on core reload.  

- [Solr Plugins](https://wiki.apache.org/solr/SolrPlugins)
- [Adding custom plugins in Solr cloud](https://lucene.apache.org/solr/guide/6_6/adding-custom-plugins-in-solrcloud-mode.html)
 
# Relevancy Feedback Plugin
An example request handler configuration for the solrconfig.xml is shown below, with comments outlining the main parameters:
```$xml
<requestHandler name="/rf" class="org.dice.solrenhancements.relevancyfeedback.RelevancyFeedbackHandler">
        <lst name="defaults">
            <str name="omitHeader">true</str>
            <str name="wt">json</str>
            <str name="indent">true</str>			
	
            <!-- Regular query configuration - query parser used when parsing the rf query-->
            <str  name="defType">lucene</str>
            <commit_msg>Add build notes.<commit_after>Dice Relevancy Feedback
========================

Dice.com's solr plugins for performing personalized search, and recommendations (via the relevancy feedback plugin) and conceptual / semantic search (via the unsupervised feedback plugin).

## Building the Plugin
A pre-built jar file can be found in the ```./target``` folder. The project contains a maven pom.xml file which can also be used to build it from source.

## Supported Solr versions
Current branch is compiled for Solr 5.4. I will be adding branches compiled against Solr 6 versions shortly. If there is a particular version of Solr you need this for, please create a GitHub issue and I'll see what I can do.
To manually compile it for a later version, use maven to compile the plugins using the pom.xml file, and update the versions of the solr and lucene libraries in that file, and use maven to pull in those dependencies. Then fix any compilation errors. Later versions of solr (6.x) use query builders to build the boolean queries, which is likely what needs to be fixed to support 6.x.
 
## Importing into SOLR
Please see the official SOLR guidelines for registering plugins with solr. This basically involves simply dropping the jar file into one of the folders that Solr checks for class and jar files on core reload.  

- [Solr Plugins](https://wiki.apache.org/solr/SolrPlugins)
- [Adding custom plugins in Solr cloud](https://lucene.apache.org/solr/guide/6_6/adding-custom-plugins-in-solrcloud-mode.html)
 
# Relevancy Feedback Plugin
An example request handler configuration for the solrconfig.xml is shown below, with comments outlining the main parameters:
```$xml
<requestHandler name="/rf" class="org.dice.solrenhancements.relevancyfeedback.RelevancyFeedbackHandler">
        <lst name="defaults">
            <str name="omitHeader">true</str>
            <str name="wt">json</str>
            <str name="indent">true</str>			
	
            <!-- Regular query configuration - query parser used when parsing the rf query-->
            <str  name="defType">lucene</str>
            
{'fraction_non_alphanumeric': 0.08388198000487686, 'fraction_numerical': 0.003413801511826384, 'mean_word_length': 3.8659549228944248, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1127799', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1033, 'n_words': 513}