[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16362240#comment-16362240 ] Tom Mortimer commented on SOLR-7341: Just added a patch for branch_7_2. > xjoin - join data from external sources > --- > > Key: SOLR-7341 > URL: https://issues.apache.org/jira/browse/SOLR-7341 > Project: Solr > Issue Type: New Feature > Components: search >Reporter: Tom Winch >Priority: Minor > Fix For: 4.10.3, 5.3.2, 6.0 > > Attachments: SOLR-7341.patch-4.10.3, SOLR-7341.patch-4_10, > SOLR-7341.patch-5.3.2, SOLR-7341.patch-5_3, SOLR-7341.patch-7.2.1, > SOLR-7341.patch-master, SOLR-7341.patch-trunk, SOLR-7341.patch-trunk > > > h2. XJoin > The "xjoin" SOLR contrib allows external results to be joined with SOLR > results in a query and the SOLR result set to be filtered by the results of > an external query. Values from the external results are made available in the > SOLR results and may also be used to boost the scores of corresponding > documents during the search. The contrib consists of the Java classes > XJoinSearchComponent, XJoinValueSourceParser and XJoinQParserPlugin (and > associated classes), which must be configured in solrconfig.xml, and the > interfaces XJoinResultsFactory and XJoinResults, which are implemented by the > user to provide the link between SOLR and the external results source (but > see below for details of how to use the in-built SimpleXJoinResultsFactory > implementation). External results and SOLR documents are matched via a single > configurable attribute (the "join field"). > To include the XJoin contrib classes, add the following config to > solrconfig.xml: > {code:xml} > > .. > >regex=".*\.jar" /> >regex="solr-xjoin-\d.*\.jar" /> > .. > > {code} > Note that any JARs containing implementations of the XJoinResultsFactory must > also be included. > h2. Java classes and interfaces > h3. XJoinResultsFactory > The user implementation of this interface is responsible for connecting to an > external source to perform a query (or otherwise collect results). Parameters > with prefix ".external." are passed from the SOLR query URL > to pararameterise the search. The interface has the following methods: > * void init(NamedList args) - this is called during SOLR initialisation, and > passed parameters from the search component configuration (see below) > * XJoinResults getResults(SolrParams params) - this is called during a SOLR > search to generate external results, and is passed parameters from the SOLR > query URL (as above) > For example, the implementation might perform queries of an external source > based on the 'q' SOLR query URL parameter (in full, name>.external.q). > h3. XJoinResults > A user implementation of this interface is returned by the getResults() > method of the XJoinResultsFactory implementation. It has methods: > * Object getResult(String joinId) - this should return a particular result > given the value of the join attribute > * Iterable getJoinIds() - this should return an ordered (ascending) > list of the join attribute values for all results of the external search > h3. XJoinSearchComponent > This is the central Java class of the contrib. It is a SOLR search component, > configured in solrconfig.xml and included in one or more SOLR request > handlers. There is one XJoin search component per external source, and each > has two main responsibilities: > * Before the SOLR search, it connects to the external source and retrieves > results, storing them in the SOLR request context > * After the SOLR search, it matches SOLR document in the results set and > external results via the join field, adding attributes from the external > results to documents in the SOLR results set > It takes the following initialisation parameters: > * factoryClass - this specifies the user-supplied class implementing > XJoinResultsFactory, used to generate external results > * joinField - this specifies the attribute on which to join between SOLR > documents and external results > * external - this parameter set is passed to configure the > XJoinResultsFactory implementation > For example, in solrconfig.xml: > {code:xml} > class="org.apache.solr.search.xjoin.XJoinSearchComponent"> > test.TestXJoinResultsFactory > id > > 1,2,3 > > > {code} > Here, the search component instantiates a new TextXJoinResultsFactory during > initialisation, and passes it the "values" parameter (1, 2, 3) to configure > it. To properly use the XJoinSearchComponent in a request handler, it must be > included at the start and end of the component list, and may be configured > with the following query parameters: > * results - a comma-separated list of attributes from the XJoinResults > implementation (created
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15870756#comment-15870756 ] Erick Erickson commented on SOLR-7341: -- Shamik: In a word no. The "fix versions" are suggestions of what was current when the patch was first created. I would guess the last version it was applied to successfully was 4.10.3. Best, Erick > xjoin - join data from external sources > --- > > Key: SOLR-7341 > URL: https://issues.apache.org/jira/browse/SOLR-7341 > Project: Solr > Issue Type: New Feature > Components: search >Reporter: Tom Winch >Priority: Minor > Fix For: 4.10.3, 5.3.2, 6.0 > > Attachments: SOLR-7341.patch-4_10, SOLR-7341.patch-4.10.3, > SOLR-7341.patch-5_3, SOLR-7341.patch-5.3.2, SOLR-7341.patch-master, > SOLR-7341.patch-trunk, SOLR-7341.patch-trunk > > > h2. XJoin > The "xjoin" SOLR contrib allows external results to be joined with SOLR > results in a query and the SOLR result set to be filtered by the results of > an external query. Values from the external results are made available in the > SOLR results and may also be used to boost the scores of corresponding > documents during the search. The contrib consists of the Java classes > XJoinSearchComponent, XJoinValueSourceParser and XJoinQParserPlugin (and > associated classes), which must be configured in solrconfig.xml, and the > interfaces XJoinResultsFactory and XJoinResults, which are implemented by the > user to provide the link between SOLR and the external results source (but > see below for details of how to use the in-built SimpleXJoinResultsFactory > implementation). External results and SOLR documents are matched via a single > configurable attribute (the "join field"). > To include the XJoin contrib classes, add the following config to > solrconfig.xml: > {code:xml} > > .. > >regex=".*\.jar" /> >regex="solr-xjoin-\d.*\.jar" /> > .. > > {code} > Note that any JARs containing implementations of the XJoinResultsFactory must > also be included. > h2. Java classes and interfaces > h3. XJoinResultsFactory > The user implementation of this interface is responsible for connecting to an > external source to perform a query (or otherwise collect results). Parameters > with prefix ".external." are passed from the SOLR query URL > to pararameterise the search. The interface has the following methods: > * void init(NamedList args) - this is called during SOLR initialisation, and > passed parameters from the search component configuration (see below) > * XJoinResults getResults(SolrParams params) - this is called during a SOLR > search to generate external results, and is passed parameters from the SOLR > query URL (as above) > For example, the implementation might perform queries of an external source > based on the 'q' SOLR query URL parameter (in full, name>.external.q). > h3. XJoinResults > A user implementation of this interface is returned by the getResults() > method of the XJoinResultsFactory implementation. It has methods: > * Object getResult(String joinId) - this should return a particular result > given the value of the join attribute > * Iterable getJoinIds() - this should return an ordered (ascending) > list of the join attribute values for all results of the external search > h3. XJoinSearchComponent > This is the central Java class of the contrib. It is a SOLR search component, > configured in solrconfig.xml and included in one or more SOLR request > handlers. There is one XJoin search component per external source, and each > has two main responsibilities: > * Before the SOLR search, it connects to the external source and retrieves > results, storing them in the SOLR request context > * After the SOLR search, it matches SOLR document in the results set and > external results via the join field, adding attributes from the external > results to documents in the SOLR results set > It takes the following initialisation parameters: > * factoryClass - this specifies the user-supplied class implementing > XJoinResultsFactory, used to generate external results > * joinField - this specifies the attribute on which to join between SOLR > documents and external results > * external - this parameter set is passed to configure the > XJoinResultsFactory implementation > For example, in solrconfig.xml: > {code:xml} > class="org.apache.solr.search.xjoin.XJoinSearchComponent"> > test.TestXJoinResultsFactory > id > > 1,2,3 > > > {code} > Here, the search component instantiates a new TextXJoinResultsFactory during > initialisation, and passes it the "values" parameter (1, 2, 3) to configure > it. To properly use the XJoinSearchComponent in a request handler, it must be > included at the start and end of the component list, and may be
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15870538#comment-15870538 ] Shamik Bandopadhyay commented on SOLR-7341: --- The master or the trunk patch (SOLR-7341.patch-master/SOLR-7341.patch-trunk) doesn't seem to work with 5.5 version onwards. I've tried applying the patch on 5.5/6.0/master source code, but it fails. Is it compatible with the above versions? > xjoin - join data from external sources > --- > > Key: SOLR-7341 > URL: https://issues.apache.org/jira/browse/SOLR-7341 > Project: Solr > Issue Type: New Feature > Components: search >Reporter: Tom Winch >Priority: Minor > Fix For: 4.10.3, 5.3.2, 6.0 > > Attachments: SOLR-7341.patch-4_10, SOLR-7341.patch-4.10.3, > SOLR-7341.patch-5_3, SOLR-7341.patch-5.3.2, SOLR-7341.patch-master, > SOLR-7341.patch-trunk, SOLR-7341.patch-trunk > > > h2. XJoin > The "xjoin" SOLR contrib allows external results to be joined with SOLR > results in a query and the SOLR result set to be filtered by the results of > an external query. Values from the external results are made available in the > SOLR results and may also be used to boost the scores of corresponding > documents during the search. The contrib consists of the Java classes > XJoinSearchComponent, XJoinValueSourceParser and XJoinQParserPlugin (and > associated classes), which must be configured in solrconfig.xml, and the > interfaces XJoinResultsFactory and XJoinResults, which are implemented by the > user to provide the link between SOLR and the external results source (but > see below for details of how to use the in-built SimpleXJoinResultsFactory > implementation). External results and SOLR documents are matched via a single > configurable attribute (the "join field"). > To include the XJoin contrib classes, add the following config to > solrconfig.xml: > {code:xml} > > .. > >regex=".*\.jar" /> >regex="solr-xjoin-\d.*\.jar" /> > .. > > {code} > Note that any JARs containing implementations of the XJoinResultsFactory must > also be included. > h2. Java classes and interfaces > h3. XJoinResultsFactory > The user implementation of this interface is responsible for connecting to an > external source to perform a query (or otherwise collect results). Parameters > with prefix ".external." are passed from the SOLR query URL > to pararameterise the search. The interface has the following methods: > * void init(NamedList args) - this is called during SOLR initialisation, and > passed parameters from the search component configuration (see below) > * XJoinResults getResults(SolrParams params) - this is called during a SOLR > search to generate external results, and is passed parameters from the SOLR > query URL (as above) > For example, the implementation might perform queries of an external source > based on the 'q' SOLR query URL parameter (in full, name>.external.q). > h3. XJoinResults > A user implementation of this interface is returned by the getResults() > method of the XJoinResultsFactory implementation. It has methods: > * Object getResult(String joinId) - this should return a particular result > given the value of the join attribute > * Iterable getJoinIds() - this should return an ordered (ascending) > list of the join attribute values for all results of the external search > h3. XJoinSearchComponent > This is the central Java class of the contrib. It is a SOLR search component, > configured in solrconfig.xml and included in one or more SOLR request > handlers. There is one XJoin search component per external source, and each > has two main responsibilities: > * Before the SOLR search, it connects to the external source and retrieves > results, storing them in the SOLR request context > * After the SOLR search, it matches SOLR document in the results set and > external results via the join field, adding attributes from the external > results to documents in the SOLR results set > It takes the following initialisation parameters: > * factoryClass - this specifies the user-supplied class implementing > XJoinResultsFactory, used to generate external results > * joinField - this specifies the attribute on which to join between SOLR > documents and external results > * external - this parameter set is passed to configure the > XJoinResultsFactory implementation > For example, in solrconfig.xml: > {code:xml} > class="org.apache.solr.search.xjoin.XJoinSearchComponent"> > test.TestXJoinResultsFactory > id > > 1,2,3 > > > {code} > Here, the search component instantiates a new TextXJoinResultsFactory during > initialisation, and passes it the "values" parameter (1, 2, 3) to configure > it. To properly use the XJoinSearchComponent in a request handler, it must be > included at
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15422078#comment-15422078 ] Saar Carmi commented on SOLR-7341: -- This jira seems to be related to https://issues.apache.org/jira/browse/SOLR-1715 (should I add a link?) Also discussed here in 2010 - http://goo.gl/ywSQZJ In our scenario, the users of our systems are looking to query an external source which may produce a file containing large amount of values and then query Solr against these values. Is the patch optimized for scenario where the external source provides a large amount of values? (hundreds of thousands) > xjoin - join data from external sources > --- > > Key: SOLR-7341 > URL: https://issues.apache.org/jira/browse/SOLR-7341 > Project: Solr > Issue Type: New Feature > Components: search >Reporter: Tom Winch >Priority: Minor > Fix For: 4.10.3, 5.3.2, 6.0 > > Attachments: SOLR-7341.patch-4.10.3, SOLR-7341.patch-4_10, > SOLR-7341.patch-5.3.2, SOLR-7341.patch-5_3, SOLR-7341.patch-master, > SOLR-7341.patch-trunk, SOLR-7341.patch-trunk > > > h2. XJoin > The "xjoin" SOLR contrib allows external results to be joined with SOLR > results in a query and the SOLR result set to be filtered by the results of > an external query. Values from the external results are made available in the > SOLR results and may also be used to boost the scores of corresponding > documents during the search. The contrib consists of the Java classes > XJoinSearchComponent, XJoinValueSourceParser and XJoinQParserPlugin (and > associated classes), which must be configured in solrconfig.xml, and the > interfaces XJoinResultsFactory and XJoinResults, which are implemented by the > user to provide the link between SOLR and the external results source (but > see below for details of how to use the in-built SimpleXJoinResultsFactory > implementation). External results and SOLR documents are matched via a single > configurable attribute (the "join field"). > To include the XJoin contrib classes, add the following config to > solrconfig.xml: > {code:xml} > > .. > >regex=".*\.jar" /> >regex="solr-xjoin-\d.*\.jar" /> > .. > > {code} > Note that any JARs containing implementations of the XJoinResultsFactory must > also be included. > h2. Java classes and interfaces > h3. XJoinResultsFactory > The user implementation of this interface is responsible for connecting to an > external source to perform a query (or otherwise collect results). Parameters > with prefix ".external." are passed from the SOLR query URL > to pararameterise the search. The interface has the following methods: > * void init(NamedList args) - this is called during SOLR initialisation, and > passed parameters from the search component configuration (see below) > * XJoinResults getResults(SolrParams params) - this is called during a SOLR > search to generate external results, and is passed parameters from the SOLR > query URL (as above) > For example, the implementation might perform queries of an external source > based on the 'q' SOLR query URL parameter (in full, name>.external.q). > h3. XJoinResults > A user implementation of this interface is returned by the getResults() > method of the XJoinResultsFactory implementation. It has methods: > * Object getResult(String joinId) - this should return a particular result > given the value of the join attribute > * Iterable getJoinIds() - this should return an ordered (ascending) > list of the join attribute values for all results of the external search > h3. XJoinSearchComponent > This is the central Java class of the contrib. It is a SOLR search component, > configured in solrconfig.xml and included in one or more SOLR request > handlers. There is one XJoin search component per external source, and each > has two main responsibilities: > * Before the SOLR search, it connects to the external source and retrieves > results, storing them in the SOLR request context > * After the SOLR search, it matches SOLR document in the results set and > external results via the join field, adding attributes from the external > results to documents in the SOLR results set > It takes the following initialisation parameters: > * factoryClass - this specifies the user-supplied class implementing > XJoinResultsFactory, used to generate external results > * joinField - this specifies the attribute on which to join between SOLR > documents and external results > * external - this parameter set is passed to configure the > XJoinResultsFactory implementation > For example, in solrconfig.xml: > {code:xml} > class="org.apache.solr.search.xjoin.XJoinSearchComponent"> > test.TestXJoinResultsFactory > id > > 1,2,3 > > > {code} > Here, the search component instantiates a new
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15362942#comment-15362942 ] Otis Gospodnetic commented on SOLR-7341: [~adamgamble] - vote for it :) > xjoin - join data from external sources > --- > > Key: SOLR-7341 > URL: https://issues.apache.org/jira/browse/SOLR-7341 > Project: Solr > Issue Type: New Feature > Components: search >Reporter: Tom Winch >Priority: Minor > Fix For: 4.10.3, 5.3.2, 6.0 > > Attachments: SOLR-7341.patch-4.10.3, SOLR-7341.patch-4_10, > SOLR-7341.patch-5.3.2, SOLR-7341.patch-5_3, SOLR-7341.patch-master, > SOLR-7341.patch-trunk, SOLR-7341.patch-trunk > > > h2. XJoin > The "xjoin" SOLR contrib allows external results to be joined with SOLR > results in a query and the SOLR result set to be filtered by the results of > an external query. Values from the external results are made available in the > SOLR results and may also be used to boost the scores of corresponding > documents during the search. The contrib consists of the Java classes > XJoinSearchComponent, XJoinValueSourceParser and XJoinQParserPlugin (and > associated classes), which must be configured in solrconfig.xml, and the > interfaces XJoinResultsFactory and XJoinResults, which are implemented by the > user to provide the link between SOLR and the external results source (but > see below for details of how to use the in-built SimpleXJoinResultsFactory > implementation). External results and SOLR documents are matched via a single > configurable attribute (the "join field"). > To include the XJoin contrib classes, add the following config to > solrconfig.xml: > {code:xml} > > .. > >regex=".*\.jar" /> >regex="solr-xjoin-\d.*\.jar" /> > .. > > {code} > Note that any JARs containing implementations of the XJoinResultsFactory must > also be included. > h2. Java classes and interfaces > h3. XJoinResultsFactory > The user implementation of this interface is responsible for connecting to an > external source to perform a query (or otherwise collect results). Parameters > with prefix ".external." are passed from the SOLR query URL > to pararameterise the search. The interface has the following methods: > * void init(NamedList args) - this is called during SOLR initialisation, and > passed parameters from the search component configuration (see below) > * XJoinResults getResults(SolrParams params) - this is called during a SOLR > search to generate external results, and is passed parameters from the SOLR > query URL (as above) > For example, the implementation might perform queries of an external source > based on the 'q' SOLR query URL parameter (in full, name>.external.q). > h3. XJoinResults > A user implementation of this interface is returned by the getResults() > method of the XJoinResultsFactory implementation. It has methods: > * Object getResult(String joinId) - this should return a particular result > given the value of the join attribute > * Iterable getJoinIds() - this should return an ordered (ascending) > list of the join attribute values for all results of the external search > h3. XJoinSearchComponent > This is the central Java class of the contrib. It is a SOLR search component, > configured in solrconfig.xml and included in one or more SOLR request > handlers. There is one XJoin search component per external source, and each > has two main responsibilities: > * Before the SOLR search, it connects to the external source and retrieves > results, storing them in the SOLR request context > * After the SOLR search, it matches SOLR document in the results set and > external results via the join field, adding attributes from the external > results to documents in the SOLR results set > It takes the following initialisation parameters: > * factoryClass - this specifies the user-supplied class implementing > XJoinResultsFactory, used to generate external results > * joinField - this specifies the attribute on which to join between SOLR > documents and external results > * external - this parameter set is passed to configure the > XJoinResultsFactory implementation > For example, in solrconfig.xml: > {code:xml} > class="org.apache.solr.search.xjoin.XJoinSearchComponent"> > test.TestXJoinResultsFactory > id > > 1,2,3 > > > {code} > Here, the search component instantiates a new TextXJoinResultsFactory during > initialisation, and passes it the "values" parameter (1, 2, 3) to configure > it. To properly use the XJoinSearchComponent in a request handler, it must be > included at the start and end of the component list, and may be configured > with the following query parameters: > * results - a comma-separated list of attributes from the XJoinResults > implementation (created by the factory at
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15323349#comment-15323349 ] Adam Gamble commented on SOLR-7341: --- I would love this feature as well. Is there a chance this will get merged? Or is it dead in the water? > xjoin - join data from external sources > --- > > Key: SOLR-7341 > URL: https://issues.apache.org/jira/browse/SOLR-7341 > Project: Solr > Issue Type: New Feature > Components: search >Reporter: Tom Winch >Priority: Minor > Fix For: 4.10.3, 5.3.2, 6.0 > > Attachments: SOLR-7341.patch-4.10.3, SOLR-7341.patch-4_10, > SOLR-7341.patch-5.3.2, SOLR-7341.patch-5_3, SOLR-7341.patch-master, > SOLR-7341.patch-trunk, SOLR-7341.patch-trunk > > > h2. XJoin > The "xjoin" SOLR contrib allows external results to be joined with SOLR > results in a query and the SOLR result set to be filtered by the results of > an external query. Values from the external results are made available in the > SOLR results and may also be used to boost the scores of corresponding > documents during the search. The contrib consists of the Java classes > XJoinSearchComponent, XJoinValueSourceParser and XJoinQParserPlugin (and > associated classes), which must be configured in solrconfig.xml, and the > interfaces XJoinResultsFactory and XJoinResults, which are implemented by the > user to provide the link between SOLR and the external results source (but > see below for details of how to use the in-built SimpleXJoinResultsFactory > implementation). External results and SOLR documents are matched via a single > configurable attribute (the "join field"). > To include the XJoin contrib classes, add the following config to > solrconfig.xml: > {code:xml} > > .. > >regex=".*\.jar" /> >regex="solr-xjoin-\d.*\.jar" /> > .. > > {code} > Note that any JARs containing implementations of the XJoinResultsFactory must > also be included. > h2. Java classes and interfaces > h3. XJoinResultsFactory > The user implementation of this interface is responsible for connecting to an > external source to perform a query (or otherwise collect results). Parameters > with prefix ".external." are passed from the SOLR query URL > to pararameterise the search. The interface has the following methods: > * void init(NamedList args) - this is called during SOLR initialisation, and > passed parameters from the search component configuration (see below) > * XJoinResults getResults(SolrParams params) - this is called during a SOLR > search to generate external results, and is passed parameters from the SOLR > query URL (as above) > For example, the implementation might perform queries of an external source > based on the 'q' SOLR query URL parameter (in full, name>.external.q). > h3. XJoinResults > A user implementation of this interface is returned by the getResults() > method of the XJoinResultsFactory implementation. It has methods: > * Object getResult(String joinId) - this should return a particular result > given the value of the join attribute > * Iterable getJoinIds() - this should return an ordered (ascending) > list of the join attribute values for all results of the external search > h3. XJoinSearchComponent > This is the central Java class of the contrib. It is a SOLR search component, > configured in solrconfig.xml and included in one or more SOLR request > handlers. There is one XJoin search component per external source, and each > has two main responsibilities: > * Before the SOLR search, it connects to the external source and retrieves > results, storing them in the SOLR request context > * After the SOLR search, it matches SOLR document in the results set and > external results via the join field, adding attributes from the external > results to documents in the SOLR results set > It takes the following initialisation parameters: > * factoryClass - this specifies the user-supplied class implementing > XJoinResultsFactory, used to generate external results > * joinField - this specifies the attribute on which to join between SOLR > documents and external results > * external - this parameter set is passed to configure the > XJoinResultsFactory implementation > For example, in solrconfig.xml: > {code:xml} > class="org.apache.solr.search.xjoin.XJoinSearchComponent"> > test.TestXJoinResultsFactory > id > > 1,2,3 > > > {code} > Here, the search component instantiates a new TextXJoinResultsFactory during > initialisation, and passes it the "values" parameter (1, 2, 3) to configure > it. To properly use the XJoinSearchComponent in a request handler, it must be > included at the start and end of the component list, and may be configured > with the following query parameters: > * results - a comma-separated list of attributes from
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15215950#comment-15215950 ] Tom Winch commented on SOLR-7341: - Thanks for your input, Erick! My feeling is that this JIRA would work independently to SA. I don't think it is incompatible at all. However I don't think it would be right to use XJoin for Solr/Solr, that feels like hammer to crack a nut. > xjoin - join data from external sources > --- > > Key: SOLR-7341 > URL: https://issues.apache.org/jira/browse/SOLR-7341 > Project: Solr > Issue Type: New Feature > Components: search >Reporter: Tom Winch >Priority: Minor > Fix For: 4.10.3, 5.3.2, master > > Attachments: SOLR-7341.patch-4.10.3, SOLR-7341.patch-4_10, > SOLR-7341.patch-5.3.2, SOLR-7341.patch-5_3, SOLR-7341.patch-master, > SOLR-7341.patch-trunk, SOLR-7341.patch-trunk > > > h2. XJoin > The "xjoin" SOLR contrib allows external results to be joined with SOLR > results in a query and the SOLR result set to be filtered by the results of > an external query. Values from the external results are made available in the > SOLR results and may also be used to boost the scores of corresponding > documents during the search. The contrib consists of the Java classes > XJoinSearchComponent, XJoinValueSourceParser and XJoinQParserPlugin (and > associated classes), which must be configured in solrconfig.xml, and the > interfaces XJoinResultsFactory and XJoinResults, which are implemented by the > user to provide the link between SOLR and the external results source (but > see below for details of how to use the in-built SimpleXJoinResultsFactory > implementation). External results and SOLR documents are matched via a single > configurable attribute (the "join field"). > To include the XJoin contrib classes, add the following config to > solrconfig.xml: > {code:xml} > > .. > >regex=".*\.jar" /> >regex="solr-xjoin-\d.*\.jar" /> > .. > > {code} > Note that any JARs containing implementations of the XJoinResultsFactory must > also be included. > h2. Java classes and interfaces > h3. XJoinResultsFactory > The user implementation of this interface is responsible for connecting to an > external source to perform a query (or otherwise collect results). Parameters > with prefix ".external." are passed from the SOLR query URL > to pararameterise the search. The interface has the following methods: > * void init(NamedList args) - this is called during SOLR initialisation, and > passed parameters from the search component configuration (see below) > * XJoinResults getResults(SolrParams params) - this is called during a SOLR > search to generate external results, and is passed parameters from the SOLR > query URL (as above) > For example, the implementation might perform queries of an external source > based on the 'q' SOLR query URL parameter (in full, name>.external.q). > h3. XJoinResults > A user implementation of this interface is returned by the getResults() > method of the XJoinResultsFactory implementation. It has methods: > * Object getResult(String joinId) - this should return a particular result > given the value of the join attribute > * Iterable getJoinIds() - this should return an ordered (ascending) > list of the join attribute values for all results of the external search > h3. XJoinSearchComponent > This is the central Java class of the contrib. It is a SOLR search component, > configured in solrconfig.xml and included in one or more SOLR request > handlers. There is one XJoin search component per external source, and each > has two main responsibilities: > * Before the SOLR search, it connects to the external source and retrieves > results, storing them in the SOLR request context > * After the SOLR search, it matches SOLR document in the results set and > external results via the join field, adding attributes from the external > results to documents in the SOLR results set > It takes the following initialisation parameters: > * factoryClass - this specifies the user-supplied class implementing > XJoinResultsFactory, used to generate external results > * joinField - this specifies the attribute on which to join between SOLR > documents and external results > * external - this parameter set is passed to configure the > XJoinResultsFactory implementation > For example, in solrconfig.xml: > {code:xml} > class="org.apache.solr.search.xjoin.XJoinSearchComponent"> > test.TestXJoinResultsFactory > id > > 1,2,3 > > > {code} > Here, the search component instantiates a new TextXJoinResultsFactory during > initialisation, and passes it the "values" parameter (1, 2, 3) to configure > it. To properly use the XJoinSearchComponent in a request handler, it must be > included at the start and end
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15208598#comment-15208598 ] Erick Erickson commented on SOLR-7341: -- You're right, SA is designed for Solr/Solr connections. That said, there's nothing in SA that _precludes_ either decorating the returns or enriching the Solr stream with information from another source. There are some restrictions, primarily the only data that can be returned is docValues. Plus SA is a SolrJ construct thus not as easy to use. Please understand, I'm not against this JIRA, there's obviously been a huge amount of work done for this patch (and even documentation!). I can see where there this would fill a real need and expand Solr's capabilities greatly. And SA may not be incompatible with this JIRA at all, perhaps even a way to realize the Solr/Solr version. All the work on the parsing, syntax etc. could probably be used as-is. Mostly, I'm trying to be sure we're considering whether SA could be used to make things more scalable etc. > xjoin - join data from external sources > --- > > Key: SOLR-7341 > URL: https://issues.apache.org/jira/browse/SOLR-7341 > Project: Solr > Issue Type: New Feature > Components: search >Reporter: Tom Winch >Priority: Minor > Fix For: 4.10.3, 5.3.2, master > > Attachments: SOLR-7341.patch-4.10.3, SOLR-7341.patch-4_10, > SOLR-7341.patch-5.3.2, SOLR-7341.patch-5_3, SOLR-7341.patch-master, > SOLR-7341.patch-trunk, SOLR-7341.patch-trunk > > > h2. XJoin > The "xjoin" SOLR contrib allows external results to be joined with SOLR > results in a query and the SOLR result set to be filtered by the results of > an external query. Values from the external results are made available in the > SOLR results and may also be used to boost the scores of corresponding > documents during the search. The contrib consists of the Java classes > XJoinSearchComponent, XJoinValueSourceParser and XJoinQParserPlugin (and > associated classes), which must be configured in solrconfig.xml, and the > interfaces XJoinResultsFactory and XJoinResults, which are implemented by the > user to provide the link between SOLR and the external results source (but > see below for details of how to use the in-built SimpleXJoinResultsFactory > implementation). External results and SOLR documents are matched via a single > configurable attribute (the "join field"). > To include the XJoin contrib classes, add the following config to > solrconfig.xml: > {code:xml} > > .. > >regex=".*\.jar" /> >regex="solr-xjoin-\d.*\.jar" /> > .. > > {code} > Note that any JARs containing implementations of the XJoinResultsFactory must > also be included. > h2. Java classes and interfaces > h3. XJoinResultsFactory > The user implementation of this interface is responsible for connecting to an > external source to perform a query (or otherwise collect results). Parameters > with prefix ".external." are passed from the SOLR query URL > to pararameterise the search. The interface has the following methods: > * void init(NamedList args) - this is called during SOLR initialisation, and > passed parameters from the search component configuration (see below) > * XJoinResults getResults(SolrParams params) - this is called during a SOLR > search to generate external results, and is passed parameters from the SOLR > query URL (as above) > For example, the implementation might perform queries of an external source > based on the 'q' SOLR query URL parameter (in full, name>.external.q). > h3. XJoinResults > A user implementation of this interface is returned by the getResults() > method of the XJoinResultsFactory implementation. It has methods: > * Object getResult(String joinId) - this should return a particular result > given the value of the join attribute > * Iterable getJoinIds() - this should return an ordered (ascending) > list of the join attribute values for all results of the external search > h3. XJoinSearchComponent > This is the central Java class of the contrib. It is a SOLR search component, > configured in solrconfig.xml and included in one or more SOLR request > handlers. There is one XJoin search component per external source, and each > has two main responsibilities: > * Before the SOLR search, it connects to the external source and retrieves > results, storing them in the SOLR request context > * After the SOLR search, it matches SOLR document in the results set and > external results via the join field, adding attributes from the external > results to documents in the SOLR results set > It takes the following initialisation parameters: > * factoryClass - this specifies the user-supplied class implementing > XJoinResultsFactory, used to generate external results > * joinField - this
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15208424#comment-15208424 ] Tom Winch commented on SOLR-7341: - XJoin isn't like the joins on SOLR-7090 because it joins against an external data source rather than a SOLR core. In addition it decorates the standard SOLR results which is rather different to how I understand SA would behave. > xjoin - join data from external sources > --- > > Key: SOLR-7341 > URL: https://issues.apache.org/jira/browse/SOLR-7341 > Project: Solr > Issue Type: New Feature > Components: search >Reporter: Tom Winch >Priority: Minor > Fix For: 4.10.3, 5.3.2, master > > Attachments: SOLR-7341.patch-4.10.3, SOLR-7341.patch-4_10, > SOLR-7341.patch-5.3.2, SOLR-7341.patch-5_3, SOLR-7341.patch-master, > SOLR-7341.patch-trunk, SOLR-7341.patch-trunk > > > h2. XJoin > The "xjoin" SOLR contrib allows external results to be joined with SOLR > results in a query and the SOLR result set to be filtered by the results of > an external query. Values from the external results are made available in the > SOLR results and may also be used to boost the scores of corresponding > documents during the search. The contrib consists of the Java classes > XJoinSearchComponent, XJoinValueSourceParser and XJoinQParserPlugin (and > associated classes), which must be configured in solrconfig.xml, and the > interfaces XJoinResultsFactory and XJoinResults, which are implemented by the > user to provide the link between SOLR and the external results source (but > see below for details of how to use the in-built SimpleXJoinResultsFactory > implementation). External results and SOLR documents are matched via a single > configurable attribute (the "join field"). > To include the XJoin contrib classes, add the following config to > solrconfig.xml: > {code:xml} > > .. > >regex=".*\.jar" /> >regex="solr-xjoin-\d.*\.jar" /> > .. > > {code} > Note that any JARs containing implementations of the XJoinResultsFactory must > also be included. > h2. Java classes and interfaces > h3. XJoinResultsFactory > The user implementation of this interface is responsible for connecting to an > external source to perform a query (or otherwise collect results). Parameters > with prefix ".external." are passed from the SOLR query URL > to pararameterise the search. The interface has the following methods: > * void init(NamedList args) - this is called during SOLR initialisation, and > passed parameters from the search component configuration (see below) > * XJoinResults getResults(SolrParams params) - this is called during a SOLR > search to generate external results, and is passed parameters from the SOLR > query URL (as above) > For example, the implementation might perform queries of an external source > based on the 'q' SOLR query URL parameter (in full, name>.external.q). > h3. XJoinResults > A user implementation of this interface is returned by the getResults() > method of the XJoinResultsFactory implementation. It has methods: > * Object getResult(String joinId) - this should return a particular result > given the value of the join attribute > * Iterable getJoinIds() - this should return an ordered (ascending) > list of the join attribute values for all results of the external search > h3. XJoinSearchComponent > This is the central Java class of the contrib. It is a SOLR search component, > configured in solrconfig.xml and included in one or more SOLR request > handlers. There is one XJoin search component per external source, and each > has two main responsibilities: > * Before the SOLR search, it connects to the external source and retrieves > results, storing them in the SOLR request context > * After the SOLR search, it matches SOLR document in the results set and > external results via the join field, adding attributes from the external > results to documents in the SOLR results set > It takes the following initialisation parameters: > * factoryClass - this specifies the user-supplied class implementing > XJoinResultsFactory, used to generate external results > * joinField - this specifies the attribute on which to join between SOLR > documents and external results > * external - this parameter set is passed to configure the > XJoinResultsFactory implementation > For example, in solrconfig.xml: > {code:xml} > class="org.apache.solr.search.xjoin.XJoinSearchComponent"> > test.TestXJoinResultsFactory > id > > 1,2,3 > > > {code} > Here, the search component instantiates a new TextXJoinResultsFactory during > initialisation, and passes it the "values" parameter (1, 2, 3) to configure > it. To properly use the XJoinSearchComponent in a request handler, it must be > included at the start and end of the
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15205743#comment-15205743 ] Erick Erickson commented on SOLR-7341: -- See my comment for March 21, 2016 for SOLR-7090. Basically I'd like to be sure that we can't realize this functionality with Streaming Aggregation rather than adding this kind of complexity that we then have to support. I'd at least like to enumerate the pros and cons of both before anyone commits such a large amount of code. > xjoin - join data from external sources > --- > > Key: SOLR-7341 > URL: https://issues.apache.org/jira/browse/SOLR-7341 > Project: Solr > Issue Type: New Feature > Components: search >Reporter: Tom Winch >Priority: Minor > Fix For: 4.10.3, 5.3.2, master > > Attachments: SOLR-7341.patch-4.10.3, SOLR-7341.patch-4_10, > SOLR-7341.patch-5.3.2, SOLR-7341.patch-5_3, SOLR-7341.patch-master, > SOLR-7341.patch-trunk, SOLR-7341.patch-trunk > > > h2. XJoin > The "xjoin" SOLR contrib allows external results to be joined with SOLR > results in a query and the SOLR result set to be filtered by the results of > an external query. Values from the external results are made available in the > SOLR results and may also be used to boost the scores of corresponding > documents during the search. The contrib consists of the Java classes > XJoinSearchComponent, XJoinValueSourceParser and XJoinQParserPlugin (and > associated classes), which must be configured in solrconfig.xml, and the > interfaces XJoinResultsFactory and XJoinResults, which are implemented by the > user to provide the link between SOLR and the external results source (but > see below for details of how to use the in-built SimpleXJoinResultsFactory > implementation). External results and SOLR documents are matched via a single > configurable attribute (the "join field"). > To include the XJoin contrib classes, add the following config to > solrconfig.xml: > {code:xml} > > .. > >regex=".*\.jar" /> >regex="solr-xjoin-\d.*\.jar" /> > .. > > {code} > Note that any JARs containing implementations of the XJoinResultsFactory must > also be included. > h2. Java classes and interfaces > h3. XJoinResultsFactory > The user implementation of this interface is responsible for connecting to an > external source to perform a query (or otherwise collect results). Parameters > with prefix ".external." are passed from the SOLR query URL > to pararameterise the search. The interface has the following methods: > * void init(NamedList args) - this is called during SOLR initialisation, and > passed parameters from the search component configuration (see below) > * XJoinResults getResults(SolrParams params) - this is called during a SOLR > search to generate external results, and is passed parameters from the SOLR > query URL (as above) > For example, the implementation might perform queries of an external source > based on the 'q' SOLR query URL parameter (in full, name>.external.q). > h3. XJoinResults > A user implementation of this interface is returned by the getResults() > method of the XJoinResultsFactory implementation. It has methods: > * Object getResult(String joinId) - this should return a particular result > given the value of the join attribute > * Iterable getJoinIds() - this should return an ordered (ascending) > list of the join attribute values for all results of the external search > h3. XJoinSearchComponent > This is the central Java class of the contrib. It is a SOLR search component, > configured in solrconfig.xml and included in one or more SOLR request > handlers. There is one XJoin search component per external source, and each > has two main responsibilities: > * Before the SOLR search, it connects to the external source and retrieves > results, storing them in the SOLR request context > * After the SOLR search, it matches SOLR document in the results set and > external results via the join field, adding attributes from the external > results to documents in the SOLR results set > It takes the following initialisation parameters: > * factoryClass - this specifies the user-supplied class implementing > XJoinResultsFactory, used to generate external results > * joinField - this specifies the attribute on which to join between SOLR > documents and external results > * external - this parameter set is passed to configure the > XJoinResultsFactory implementation > For example, in solrconfig.xml: > {code:xml} > class="org.apache.solr.search.xjoin.XJoinSearchComponent"> > test.TestXJoinResultsFactory > id > > 1,2,3 > > > {code} > Here, the search component instantiates a new TextXJoinResultsFactory during > initialisation, and passes it the "values" parameter (1, 2, 3) to configure > it. To
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15062077#comment-15062077 ] Tom Winch commented on SOLR-7341: - Done > xjoin - join data from external sources > --- > > Key: SOLR-7341 > URL: https://issues.apache.org/jira/browse/SOLR-7341 > Project: Solr > Issue Type: New Feature > Components: search >Affects Versions: 4.10.3 >Reporter: Tom Winch >Priority: Minor > Fix For: Trunk > > Attachments: SOLR-7341.patch, SOLR-7341.patch, SOLR-7341.patch, > SOLR-7341.patch, SOLR-7341.patch, SOLR-7341.patch, SOLR-7341.patch-5_3, > SOLR-7341.patch-trunk, SOLR-7341.patch-trunk, SOLR-7341.patch-trunk > > > h2. XJoin > The "xjoin" SOLR contrib allows external results to be joined with SOLR > results in a query and the SOLR result set to be filtered by the results of > an external query. Values from the external results are made available in the > SOLR results and may also be used to boost the scores of corresponding > documents during the search. The contrib consists of the Java classes > XJoinSearchComponent, XJoinValueSourceParser and XJoinQParserPlugin (and > associated classes), which must be configured in solrconfig.xml, and the > interfaces XJoinResultsFactory and XJoinResults, which are implemented by the > user to provide the link between SOLR and the external results source. > External results and SOLR documents are matched via a single configurable > attribute (the "join field"). The contrib JAR solr-xjoin-4.10.3.jar contains > these classes and interfaces and should be included in SOLR's class path from > solrconfig.xml, as should a JAR containing the user implementations of the > previously mentioned interfaces. For example: > {code:xml} > > .. > >/> > .. > > > .. > > {code} > h2. Java classes and interfaces > h3. XJoinResultsFactory > The user implementation of this interface is responsible for connecting to an > external source to perform a query (or otherwise collect results). Parameters > with prefix ".external." are passed from the SOLR query URL > to pararameterise the search. The interface has the following methods: > * void init(NamedList args) - this is called during SOLR initialisation, and > passed parameters from the search component configuration (see below) > * XJoinResults getResults(SolrParams params) - this is called during a SOLR > search to generate external results, and is passed parameters from the SOLR > query URL (as above) > For example, the implementation might perform queries of an external source > based on the 'q' SOLR query URL parameter (in full, name>.external.q). > h3. XJoinResults > A user implementation of this interface is returned by the getResults() > method of the XJoinResultsFactory implementation. It has methods: > * Object getResult(String joinId) - this should return a particular result > given the value of the join attribute > * Iterable getJoinIds() - this should return an ordered (ascending) > list of the join attribute values for all results of the external search > h3. XJoinSearchComponent > This is the central Java class of the contrib. It is a SOLR search component, > configured in solrconfig.xml and included in one or more SOLR request > handlers. There is one XJoin search component per external source, and each > has two main responsibilities: > * Before the SOLR search, it connects to the external source and retrieves > results, storing them in the SOLR request context > * After the SOLR search, it matches SOLR document in the results set and > external results via the join field, adding attributes from the external > results to documents in the SOLR results set > It takes the following initialisation parameters: > * factoryClass - this specifies the user-supplied class implementing > XJoinResultsFactory, used to generate external results > * joinField - this specifies the attribute on which to join between SOLR > documents and external results > * external - this parameter set is passed to configure the > XJoinResultsFactory implementation > For example, in solrconfig.xml: > {code:xml} > class="org.apache.solr.search.xjoin.XJoinSearchComponent"> > test.TestXJoinResultsFactory > id > > 1,2,3 > > > {code} > Here, the search component instantiates a new TextXJoinResultsFactory during > initialisation, and passes it the "values" parameter (1, 2, 3) to configure > it. To properly use the XJoinSearchComponent in a request handler, it must be > included at the start and end of the component list, and may be configured > with the following query parameters: > * results - a comma-separated list of attributes from the XJoinResults > implementation (created by the factory at search time) to be included in the > SOLR results > * fl -
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15050620#comment-15050620 ] Tom Winch commented on SOLR-7341: - I can do - I presume you tried applying the trunk patch and it didn't work? > xjoin - join data from external sources > --- > > Key: SOLR-7341 > URL: https://issues.apache.org/jira/browse/SOLR-7341 > Project: Solr > Issue Type: New Feature > Components: search >Affects Versions: 4.10.3 >Reporter: Tom Winch >Priority: Minor > Fix For: Trunk > > Attachments: SOLR-7341.patch, SOLR-7341.patch, SOLR-7341.patch, > SOLR-7341.patch, SOLR-7341.patch, SOLR-7341.patch, SOLR-7341.patch-trunk, > SOLR-7341.patch-trunk, SOLR-7341.patch-trunk > > > h2. XJoin > The "xjoin" SOLR contrib allows external results to be joined with SOLR > results in a query and the SOLR result set to be filtered by the results of > an external query. Values from the external results are made available in the > SOLR results and may also be used to boost the scores of corresponding > documents during the search. The contrib consists of the Java classes > XJoinSearchComponent, XJoinValueSourceParser and XJoinQParserPlugin (and > associated classes), which must be configured in solrconfig.xml, and the > interfaces XJoinResultsFactory and XJoinResults, which are implemented by the > user to provide the link between SOLR and the external results source. > External results and SOLR documents are matched via a single configurable > attribute (the "join field"). The contrib JAR solr-xjoin-4.10.3.jar contains > these classes and interfaces and should be included in SOLR's class path from > solrconfig.xml, as should a JAR containing the user implementations of the > previously mentioned interfaces. For example: > {code:xml} > > .. > >/> > .. > > > .. > > {code} > h2. Java classes and interfaces > h3. XJoinResultsFactory > The user implementation of this interface is responsible for connecting to an > external source to perform a query (or otherwise collect results). Parameters > with prefix ".external." are passed from the SOLR query URL > to pararameterise the search. The interface has the following methods: > * void init(NamedList args) - this is called during SOLR initialisation, and > passed parameters from the search component configuration (see below) > * XJoinResults getResults(SolrParams params) - this is called during a SOLR > search to generate external results, and is passed parameters from the SOLR > query URL (as above) > For example, the implementation might perform queries of an external source > based on the 'q' SOLR query URL parameter (in full, name>.external.q). > h3. XJoinResults > A user implementation of this interface is returned by the getResults() > method of the XJoinResultsFactory implementation. It has methods: > * Object getResult(String joinId) - this should return a particular result > given the value of the join attribute > * Iterable getJoinIds() - this should return an ordered (ascending) > list of the join attribute values for all results of the external search > h3. XJoinSearchComponent > This is the central Java class of the contrib. It is a SOLR search component, > configured in solrconfig.xml and included in one or more SOLR request > handlers. There is one XJoin search component per external source, and each > has two main responsibilities: > * Before the SOLR search, it connects to the external source and retrieves > results, storing them in the SOLR request context > * After the SOLR search, it matches SOLR document in the results set and > external results via the join field, adding attributes from the external > results to documents in the SOLR results set > It takes the following initialisation parameters: > * factoryClass - this specifies the user-supplied class implementing > XJoinResultsFactory, used to generate external results > * joinField - this specifies the attribute on which to join between SOLR > documents and external results > * external - this parameter set is passed to configure the > XJoinResultsFactory implementation > For example, in solrconfig.xml: > {code:xml} > class="org.apache.solr.search.xjoin.XJoinSearchComponent"> > test.TestXJoinResultsFactory > id > > 1,2,3 > > > {code} > Here, the search component instantiates a new TextXJoinResultsFactory during > initialisation, and passes it the "values" parameter (1, 2, 3) to configure > it. To properly use the XJoinSearchComponent in a request handler, it must be > included at the start and end of the component list, and may be configured > with the following query parameters: > * results - a comma-separated list of attributes from the XJoinResults > implementation (created by the factory at search
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15050619#comment-15050619 ] Tom Winch commented on SOLR-7341: - I can do - I presume you tried applying the trunk patch and it didn't work? > xjoin - join data from external sources > --- > > Key: SOLR-7341 > URL: https://issues.apache.org/jira/browse/SOLR-7341 > Project: Solr > Issue Type: New Feature > Components: search >Affects Versions: 4.10.3 >Reporter: Tom Winch >Priority: Minor > Fix For: Trunk > > Attachments: SOLR-7341.patch, SOLR-7341.patch, SOLR-7341.patch, > SOLR-7341.patch, SOLR-7341.patch, SOLR-7341.patch, SOLR-7341.patch-trunk, > SOLR-7341.patch-trunk, SOLR-7341.patch-trunk > > > h2. XJoin > The "xjoin" SOLR contrib allows external results to be joined with SOLR > results in a query and the SOLR result set to be filtered by the results of > an external query. Values from the external results are made available in the > SOLR results and may also be used to boost the scores of corresponding > documents during the search. The contrib consists of the Java classes > XJoinSearchComponent, XJoinValueSourceParser and XJoinQParserPlugin (and > associated classes), which must be configured in solrconfig.xml, and the > interfaces XJoinResultsFactory and XJoinResults, which are implemented by the > user to provide the link between SOLR and the external results source. > External results and SOLR documents are matched via a single configurable > attribute (the "join field"). The contrib JAR solr-xjoin-4.10.3.jar contains > these classes and interfaces and should be included in SOLR's class path from > solrconfig.xml, as should a JAR containing the user implementations of the > previously mentioned interfaces. For example: > {code:xml} > > .. > >/> > .. > > > .. > > {code} > h2. Java classes and interfaces > h3. XJoinResultsFactory > The user implementation of this interface is responsible for connecting to an > external source to perform a query (or otherwise collect results). Parameters > with prefix ".external." are passed from the SOLR query URL > to pararameterise the search. The interface has the following methods: > * void init(NamedList args) - this is called during SOLR initialisation, and > passed parameters from the search component configuration (see below) > * XJoinResults getResults(SolrParams params) - this is called during a SOLR > search to generate external results, and is passed parameters from the SOLR > query URL (as above) > For example, the implementation might perform queries of an external source > based on the 'q' SOLR query URL parameter (in full, name>.external.q). > h3. XJoinResults > A user implementation of this interface is returned by the getResults() > method of the XJoinResultsFactory implementation. It has methods: > * Object getResult(String joinId) - this should return a particular result > given the value of the join attribute > * Iterable getJoinIds() - this should return an ordered (ascending) > list of the join attribute values for all results of the external search > h3. XJoinSearchComponent > This is the central Java class of the contrib. It is a SOLR search component, > configured in solrconfig.xml and included in one or more SOLR request > handlers. There is one XJoin search component per external source, and each > has two main responsibilities: > * Before the SOLR search, it connects to the external source and retrieves > results, storing them in the SOLR request context > * After the SOLR search, it matches SOLR document in the results set and > external results via the join field, adding attributes from the external > results to documents in the SOLR results set > It takes the following initialisation parameters: > * factoryClass - this specifies the user-supplied class implementing > XJoinResultsFactory, used to generate external results > * joinField - this specifies the attribute on which to join between SOLR > documents and external results > * external - this parameter set is passed to configure the > XJoinResultsFactory implementation > For example, in solrconfig.xml: > {code:xml} > class="org.apache.solr.search.xjoin.XJoinSearchComponent"> > test.TestXJoinResultsFactory > id > > 1,2,3 > > > {code} > Here, the search component instantiates a new TextXJoinResultsFactory during > initialisation, and passes it the "values" parameter (1, 2, 3) to configure > it. To properly use the XJoinSearchComponent in a request handler, it must be > included at the start and end of the component list, and may be configured > with the following query parameters: > * results - a comma-separated list of attributes from the XJoinResults > implementation (created by the factory at search
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15038800#comment-15038800 ] Gopal Patwa commented on SOLR-7341: --- [~Tomjon] could you make a patch working with 5.x? we are exploring this option but we are on 5.3.1 version > xjoin - join data from external sources > --- > > Key: SOLR-7341 > URL: https://issues.apache.org/jira/browse/SOLR-7341 > Project: Solr > Issue Type: New Feature > Components: search >Affects Versions: 4.10.3 >Reporter: Tom Winch >Priority: Minor > Fix For: Trunk > > Attachments: SOLR-7341.patch, SOLR-7341.patch, SOLR-7341.patch, > SOLR-7341.patch, SOLR-7341.patch, SOLR-7341.patch, SOLR-7341.patch-trunk, > SOLR-7341.patch-trunk, SOLR-7341.patch-trunk > > > h2. XJoin > The "xjoin" SOLR contrib allows external results to be joined with SOLR > results in a query and the SOLR result set to be filtered by the results of > an external query. Values from the external results are made available in the > SOLR results and may also be used to boost the scores of corresponding > documents during the search. The contrib consists of the Java classes > XJoinSearchComponent, XJoinValueSourceParser and XJoinQParserPlugin (and > associated classes), which must be configured in solrconfig.xml, and the > interfaces XJoinResultsFactory and XJoinResults, which are implemented by the > user to provide the link between SOLR and the external results source. > External results and SOLR documents are matched via a single configurable > attribute (the "join field"). The contrib JAR solr-xjoin-4.10.3.jar contains > these classes and interfaces and should be included in SOLR's class path from > solrconfig.xml, as should a JAR containing the user implementations of the > previously mentioned interfaces. For example: > {code:xml} > > .. > >/> > .. > > > .. > > {code} > h2. Java classes and interfaces > h3. XJoinResultsFactory > The user implementation of this interface is responsible for connecting to an > external source to perform a query (or otherwise collect results). Parameters > with prefix ".external." are passed from the SOLR query URL > to pararameterise the search. The interface has the following methods: > * void init(NamedList args) - this is called during SOLR initialisation, and > passed parameters from the search component configuration (see below) > * XJoinResults getResults(SolrParams params) - this is called during a SOLR > search to generate external results, and is passed parameters from the SOLR > query URL (as above) > For example, the implementation might perform queries of an external source > based on the 'q' SOLR query URL parameter (in full, name>.external.q). > h3. XJoinResults > A user implementation of this interface is returned by the getResults() > method of the XJoinResultsFactory implementation. It has methods: > * Object getResult(String joinId) - this should return a particular result > given the value of the join attribute > * Iterable getJoinIds() - this should return an ordered (ascending) > list of the join attribute values for all results of the external search > h3. XJoinSearchComponent > This is the central Java class of the contrib. It is a SOLR search component, > configured in solrconfig.xml and included in one or more SOLR request > handlers. There is one XJoin search component per external source, and each > has two main responsibilities: > * Before the SOLR search, it connects to the external source and retrieves > results, storing them in the SOLR request context > * After the SOLR search, it matches SOLR document in the results set and > external results via the join field, adding attributes from the external > results to documents in the SOLR results set > It takes the following initialisation parameters: > * factoryClass - this specifies the user-supplied class implementing > XJoinResultsFactory, used to generate external results > * joinField - this specifies the attribute on which to join between SOLR > documents and external results > * external - this parameter set is passed to configure the > XJoinResultsFactory implementation > For example, in solrconfig.xml: > {code:xml} > class="org.apache.solr.search.xjoin.XJoinSearchComponent"> > test.TestXJoinResultsFactory > id > > 1,2,3 > > > {code} > Here, the search component instantiates a new TextXJoinResultsFactory during > initialisation, and passes it the "values" parameter (1, 2, 3) to configure > it. To properly use the XJoinSearchComponent in a request handler, it must be > included at the start and end of the component list, and may be configured > with the following query parameters: > * results - a comma-separated list of attributes from the XJoinResults > implementation
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14959677#comment-14959677 ] Doug Turnbull commented on SOLR-7341: - I am really looking forward to this patch. It has a lot of potential for joining search with external ranking systems like recommenders or other systems that are more appropriatte for different use cases. > xjoin - join data from external sources > --- > > Key: SOLR-7341 > URL: https://issues.apache.org/jira/browse/SOLR-7341 > Project: Solr > Issue Type: New Feature > Components: search >Affects Versions: 4.10.3 >Reporter: Tom Winch >Priority: Minor > Fix For: Trunk > > Attachments: SOLR-7341.patch, SOLR-7341.patch, SOLR-7341.patch, > SOLR-7341.patch, SOLR-7341.patch, SOLR-7341.patch, SOLR-7341.patch-trunk, > SOLR-7341.patch-trunk, SOLR-7341.patch-trunk > > > h2. XJoin > The "xjoin" SOLR contrib allows external results to be joined with SOLR > results in a query and the SOLR result set to be filtered by the results of > an external query. Values from the external results are made available in the > SOLR results and may also be used to boost the scores of corresponding > documents during the search. The contrib consists of the Java classes > XJoinSearchComponent, XJoinValueSourceParser and XJoinQParserPlugin (and > associated classes), which must be configured in solrconfig.xml, and the > interfaces XJoinResultsFactory and XJoinResults, which are implemented by the > user to provide the link between SOLR and the external results source. > External results and SOLR documents are matched via a single configurable > attribute (the "join field"). The contrib JAR solr-xjoin-4.10.3.jar contains > these classes and interfaces and should be included in SOLR's class path from > solrconfig.xml, as should a JAR containing the user implementations of the > previously mentioned interfaces. For example: > {code:xml} > > .. > >/> > .. > > > .. > > {code} > h2. Java classes and interfaces > h3. XJoinResultsFactory > The user implementation of this interface is responsible for connecting to an > external source to perform a query (or otherwise collect results). Parameters > with prefix ".external." are passed from the SOLR query URL > to pararameterise the search. The interface has the following methods: > * void init(NamedList args) - this is called during SOLR initialisation, and > passed parameters from the search component configuration (see below) > * XJoinResults getResults(SolrParams params) - this is called during a SOLR > search to generate external results, and is passed parameters from the SOLR > query URL (as above) > For example, the implementation might perform queries of an external source > based on the 'q' SOLR query URL parameter (in full, name>.external.q). > h3. XJoinResults > A user implementation of this interface is returned by the getResults() > method of the XJoinResultsFactory implementation. It has methods: > * Object getResult(String joinId) - this should return a particular result > given the value of the join attribute > * Iterable getJoinIds() - this should return an ordered (ascending) > list of the join attribute values for all results of the external search > h3. XJoinSearchComponent > This is the central Java class of the contrib. It is a SOLR search component, > configured in solrconfig.xml and included in one or more SOLR request > handlers. There is one XJoin search component per external source, and each > has two main responsibilities: > * Before the SOLR search, it connects to the external source and retrieves > results, storing them in the SOLR request context > * After the SOLR search, it matches SOLR document in the results set and > external results via the join field, adding attributes from the external > results to documents in the SOLR results set > It takes the following initialisation parameters: > * factoryClass - this specifies the user-supplied class implementing > XJoinResultsFactory, used to generate external results > * joinField - this specifies the attribute on which to join between SOLR > documents and external results > * external - this parameter set is passed to configure the > XJoinResultsFactory implementation > For example, in solrconfig.xml: > {code:xml} > class="org.apache.solr.search.xjoin.XJoinSearchComponent"> > test.TestXJoinResultsFactory > id > > 1,2,3 > > > {code} > Here, the search component instantiates a new TextXJoinResultsFactory during > initialisation, and passes it the "values" parameter (1, 2, 3) to configure > it. To properly use the XJoinSearchComponent in a request handler, it must be > included at the start and end of the component list, and may be configured > with the following query
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14626373#comment-14626373 ] Tom Winch commented on SOLR-7341: - Running against a 'toy' XJoinResultsFactory implementation (that just parrots back join ids), and an index of about 6k documents, a straightforward fq join is executed in 50ms, similarly a Boolean combination. Adding in weights using bf roughly doubles the QTime. I expect in many real world situations the time taken to call out to the external source would dominate. xjoin - join data from external sources --- Key: SOLR-7341 URL: https://issues.apache.org/jira/browse/SOLR-7341 Project: Solr Issue Type: New Feature Components: search Affects Versions: 4.10.3 Reporter: Tom Winch Priority: Minor Fix For: Trunk Attachments: SOLR-7341.patch, SOLR-7341.patch, SOLR-7341.patch, SOLR-7341.patch, SOLR-7341.patch-trunk h2. XJoin The xjoin SOLR contrib allows external results to be joined with SOLR results in a query and the SOLR result set to be filtered by the results of an external query. Values from the external results are made available in the SOLR results and may also be used to boost the scores of corresponding documents during the search. The contrib consists of the Java classes XJoinSearchComponent, XJoinValueSourceParser and XJoinQParserPlugin (and associated classes), which must be configured in solrconfig.xml, and the interfaces XJoinResultsFactory and XJoinResults, which are implemented by the user to provide the link between SOLR and the external results source. External results and SOLR documents are matched via a single configurable attribute (the join field). The contrib JAR solr-xjoin-4.10.3.jar contains these classes and interfaces and should be included in SOLR's class path from solrconfig.xml, as should a JAR containing the user implementations of the previously mentioned interfaces. For example: {code:xml} config .. !-- XJoin contrib JAR file -- lib dir=${solr.install.dir:../../..}/dist/ regex=solr-xjoin-\d.*\.jar / .. !-- user implementations of XJoin interfaces -- lib path=/path/to/xjoin_test.jar / .. /config {code} h2. Java classes and interfaces h3. XJoinResultsFactory The user implementation of this interface is responsible for connecting to an external source to perform a query (or otherwise collect results). Parameters with prefix component name.external. are passed from the SOLR query URL to pararameterise the search. The interface has the following methods: * void init(NamedList args) - this is called during SOLR initialisation, and passed parameters from the search component configuration (see below) * XJoinResults getResults(SolrParams params) - this is called during a SOLR search to generate external results, and is passed parameters from the SOLR query URL (as above) For example, the implementation might perform queries of an external source based on the 'q' SOLR query URL parameter (in full, component name.external.q). h3. XJoinResults A user implementation of this interface is returned by the getResults() method of the XJoinResultsFactory implementation. It has methods: * Object getResult(String joinId) - this should return a particular result given the value of the join attribute * IterableString getJoinIds() - this should return the join attribute values for all results of the external search h3. XJoinSearchComponent This is the central Java class of the contrib. It is a SOLR search component, configured in solrconfig.xml and included in one or more SOLR request handlers. There is one XJoin search component per external source, and each has two main responsibilities: * Before the SOLR search, it connects to the external source and retrieves results, storing them in the SOLR request context * After the SOLR search, it matches SOLR document in the results set and external results via the join field, adding attributes from the external results to documents in the SOLR results set It takes the following initialisation parameters: * factoryClass - this specifies the user-supplied class implementing XJoinResultsFactory, used to generate external results * joinField - this specifies the attribute on which to join between SOLR documents and external results * external - this parameter set is passed to configure the XJoinResultsFactory implementation For example, in solrconfig.xml: {code:xml} searchComponent name=xjoin_test class=org.apache.solr.search.xjoin.XJoinSearchComponent str name=factoryClasstest.TestXJoinResultsFactory/str str name=joinFieldid/str lst name=external str name=values1,2,3/str /lst /searchComponent {code} Here, the search
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14599507#comment-14599507 ] Alan Woodward commented on SOLR-7341: - Hi Tom, This looks great! A couple of questions: * This looks like it's built against 4.x. Could you make a patch that compiles against trunk? * Do you have any performance numbers for this? I'm not sure if we have any kind of general policy about accepting contrib/ patches. This looks sufficiently generally useful that it would be worth committing though. xjoin - join data from external sources --- Key: SOLR-7341 URL: https://issues.apache.org/jira/browse/SOLR-7341 Project: Solr Issue Type: New Feature Components: search Affects Versions: 4.10.3 Reporter: Tom Winch Priority: Minor Fix For: Trunk Attachments: SOLR-7341.patch, SOLR-7341.patch h2. XJoin The xjoin SOLR contrib allows external results to be joined with SOLR results in a query and the SOLR result set to be filtered by the results of an external query. Values from the external results are made available in the SOLR results and may also be used to boost the scores of corresponding documents during the search. The contrib consists of the Java classes XJoinSearchComponent, XJoinValueSourceParser and XJoinQParserPlugin (and associated classes), which must be configured in solrconfig.xml, and the interfaces XJoinResultsFactory and XJoinResults, which are implemented by the user to provide the link between SOLR and the external results source. External results and SOLR documents are matched via a single configurable attribute (the join field). The contrib JAR solr-xjoin-4.10.3.jar contains these classes and interfaces and should be included in SOLR's class path from solrconfig.xml, as should a JAR containing the user implementations of the previously mentioned interfaces. For example: {code:xml} config .. !-- XJoin contrib JAR file -- lib dir=${solr.install.dir:../../..}/dist/ regex=solr-xjoin-\d.*\.jar / .. !-- user implementations of XJoin interfaces -- lib path=/path/to/xjoin_test.jar / .. /config {code} h2. Java classes and interfaces h3. XJoinResultsFactory The user implementation of this interface is responsible for connecting to an external source to perform a query (or otherwise collect results). Parameters with prefix component name.external. are passed from the SOLR query URL to pararameterise the search. The interface has the following methods: * void init(NamedList args) - this is called during SOLR initialisation, and passed parameters from the search component configuration (see below) * XJoinResults getResults(SolrParams params) - this is called during a SOLR search to generate external results, and is passed parameters from the SOLR query URL (as above) For example, the implementation might perform queries of an external source based on the 'q' SOLR query URL parameter (in full, component name.external.q). h3. XJoinResults A user implementation of this interface is returned by the getResults() method of the XJoinResultsFactory implementation. It has methods: * Object getResult(String joinId) - this should return a particular result given the value of the join attribute * IterableString getJoinIds() - this should return the join attribute values for all results of the external search h3. XJoinSearchComponent This is the central Java class of the contrib. It is a SOLR search component, configured in solrconfig.xml and included in one or more SOLR request handlers. There is one XJoin search component per external source, and each has two main responsibilities: * Before the SOLR search, it connects to the external source and retrieves results, storing them in the SOLR request context * After the SOLR search, it matches SOLR document in the results set and external results via the join field, adding attributes from the external results to documents in the SOLR results set It takes the following initialisation parameters: * factoryClass - this specifies the user-supplied class implementing XJoinResultsFactory, used to generate external results * joinField - this specifies the attribute on which to join between SOLR documents and external results * external - this parameter set is passed to configure the XJoinResultsFactory implementation For example, in solrconfig.xml: {code:xml} searchComponent name=xjoin_test class=org.apache.solr.search.xjoin.XJoinSearchComponent str name=factoryClasstest.TestXJoinResultsFactory/str str name=joinFieldid/str lst name=external str name=values1,2,3/str /lst /searchComponent {code} Here, the search component instantiates a new TextXJoinResultsFactory during
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14530847#comment-14530847 ] Tom Winch commented on SOLR-7341: - Added updated patch with more support for multiple external sources (XJoinQParserPlugin) xjoin - join data from external sources --- Key: SOLR-7341 URL: https://issues.apache.org/jira/browse/SOLR-7341 Project: Solr Issue Type: New Feature Components: search Affects Versions: 4.10.3 Reporter: Tom Winch Priority: Minor Fix For: Trunk Attachments: SOLR-7341.patch, SOLR-7341.patch h2. XJoin The xjoin SOLR contrib allows external results to be joined with SOLR results in a query and the SOLR result set to be filtered by the results of an external query. Values from the external results are made available in the SOLR results and may also be used to boost the scores of corresponding documents during the search. The contrib consists of the Java classes XJoinSearchComponent, XJoinValueSourceParser and XJoinQParserPlugin (and associated classes), which must be configured in solrconfig.xml, and the interfaces XJoinResultsFactory and XJoinResults, which are implemented by the user to provide the link between SOLR and the external results source. External results and SOLR documents are matched via a single configurable attribute (the join field). The contrib JAR solr-xjoin-4.10.3.jar contains these classes and interfaces and should be included in SOLR's class path from solrconfig.xml, as should a JAR containing the user implementations of the previously mentioned interfaces. For example: {code:xml} config .. !-- XJoin contrib JAR file -- lib dir=${solr.install.dir:../../..}/dist/ regex=solr-xjoin-\d.*\.jar / .. !-- user implementations of XJoin interfaces -- lib path=/path/to/xjoin_test.jar / .. /config {code} h2. Java classes and interfaces h3. XJoinResultsFactory The user implementation of this interface is responsible for connecting to an external source to perform a query (or otherwise collect results). Parameters with prefix component name.external. are passed from the SOLR query URL to pararameterise the search. The interface has the following methods: * void init(NamedList args) - this is called during SOLR initialisation, and passed parameters from the search component configuration (see below) * XJoinResults getResults(SolrParams params) - this is called during a SOLR search to generate external results, and is passed parameters from the SOLR query URL (as above) For example, the implementation might perform queries of an external source based on the 'q' SOLR query URL parameter (in full, component name.external.q). h3. XJoinResults A user implementation of this interface is returned by the getResults() method of the XJoinResultsFactory implementation. It has methods: * Object getResult(String joinId) - this should return a particular result given the value of the join attribute * IterableString getJoinIds() - this should return the join attribute values for all results of the external search h3. XJoinSearchComponent This is the central Java class of the contrib. It is a SOLR search component, configured in solrconfig.xml and included in one or more SOLR request handlers. There is one XJoin search component per external source, and each has two main responsibilities: * Before the SOLR search, it connects to the external source and retrieves results, storing them in the SOLR request context * After the SOLR search, it matches SOLR document in the results set and external results via the join field, adding attributes from the external results to documents in the SOLR results set It takes the following initialisation parameters: * factoryClass - this specifies the user-supplied class implementing XJoinResultsFactory, used to generate external results * joinField - this specifies the attribute on which to join between SOLR documents and external results * external - this parameter set is passed to configure the XJoinResultsFactory implementation For example, in solrconfig.xml: {code:xml} searchComponent name=xjoin_test class=org.apache.solr.search.xjoin.XJoinSearchComponent str name=factoryClasstest.TestXJoinResultsFactory/str str name=joinFieldid/str lst name=external str name=values1,2,3/str /lst /searchComponent {code} Here, the search component instantiates a new TextXJoinResultsFactory during initialisation, and passes it the values parameter (1, 2, 3) to configure it. To properly use the XJoinSearchComponent in a request handler, it must be included at the start and end of the component list, and may be configured with the following query parameters: * results - a
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14485249#comment-14485249 ] Tom Winch commented on SOLR-7341: - Attached 8/4/15 xjoin - join data from external sources --- Key: SOLR-7341 URL: https://issues.apache.org/jira/browse/SOLR-7341 Project: Solr Issue Type: New Feature Components: search Affects Versions: 4.10.3 Reporter: Tom Winch Priority: Minor Fix For: Trunk Attachments: SOLR-7341.patch h2. XJoin The xjoin SOLR contrib allows external results to be joined with SOLR results in a query and the SOLR result set to be filtered by the results of an external query. Values from the external results are made available in the SOLR results and may also be used to boost the scores of corresponding documents during the search. The contrib consists of the Java classes XJoinSearchComponent and XJoinValueSourceParser, which must be configured in solrconfig.xml, and the interfaces XJoinResultsFactory and XJoinResults, which are implemented by the user to provide the link between SOLR and the external results source. External results and SOLR documents are matched via a single configurable attribute (the join field). The contrib JAR solr-xjoin-4.10.3.jar contains these classes and interfaces and should be included in SOLR's class path from solrconfig.xml, as should a JAR containing the user implementations of the previously mentioned interfaces. For example: {code:xml} config .. !-- XJoin contrib JAR file -- lib dir=${solr.install.dir:../../..}/dist/ regex=solr-xjoin-\d.*\.jar / .. !-- user implementations of XJoin interfaces -- lib path=/path/to/xjoin_test.jar / .. /config {code} h2. Java classes and interfaces h3. XJoinResultsFactory The user implementation of this interface is responsible for connecting to the external source to perform a query (or otherwise collect results). Parameters with prefix component name.external. are passed from the SOLR query URL to pararameterise the search. The interface has the following methods: * void init(NamedList args) - this is called during SOLR initialisation, and passed parameters from the search component configuration (see below) * XJoinResults getResults(SolrParams params) - this is called during a SOLR search to generate external results, and is passed parameters from the SOLR query URL (as above) For example, the implementation might perform queries of an external source based on the 'q' SOLR query URL parameter (in full, component name.external.q). h3. XJoinResults A user implementation of this interface is returned by the getResults() method of the XJoinResultsFactory implementation. It has methods: * Object getResult(String joinId) - this should return a particular result given the value of the join attribute * IterableString getJoinIds() - this should return the join attribute values for all results of the external search h3. XJoinSearchComponent This is the central Java class of the contrib. It is a SOLR search component, configured in solrconfig.xml and included in one or more SOLR request handlers. It has two main responsibilities: * Before the SOLR search, it connects to the external source and retrieves results, storing them in the SOLR request context * After the SOLR search, it matches SOLR document in the results set and external results via the join field, adding attributes from the external results to documents in the SOLR results set It takes the following initialisation parameters: * factoryClass - this specifies the user-supplied class implementing XJoinResultsFactory, used to generate external results * joinField - this specifies the attribute on which to join between SOLR documents and external results * external - this parameter set is passed to configure the XJoinResultsFactory implementation For example, in solrconfig.xml: {code:xml} searchComponent name=xjoin_test class=org.apache.solr.search.xjoin.XJoinSearchComponent str name=factoryClasstest.TestXJoinResultsFactory/str str name=joinFieldid/str lst name=external str name=values1,2,3/str /lst /searchComponent {code} Here, the search component instantiates a new TextXJoinResultsFactory during initialisation, and passes it the values parameter (1, 2, 3) to configure it. To properly use the XJoinSearchComponent in a request handler, it must be included at the start and end of the component list, and may be configured with the following query parameters: * results - a comma-separated list of attributes from the XJoinResults implementation (created by the factory at search time) to be included in the SOLR results * fl - a comma-separated list of attributes from
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14485264#comment-14485264 ] Tom Winch commented on SOLR-7341: - You need to create the directory solr/contrib/xjoin/test-lib by hand, and copy the following JAR files from the directory solr/contrib/morphlines-core/test-lib: jcl-over-slf4j-1.7.6.jarmockito-core-1.9.5.jar objenesis-1.2.jar xjoin - join data from external sources --- Key: SOLR-7341 URL: https://issues.apache.org/jira/browse/SOLR-7341 Project: Solr Issue Type: New Feature Components: search Affects Versions: 4.10.3 Reporter: Tom Winch Priority: Minor Fix For: Trunk Attachments: SOLR-7341.patch h2. XJoin The xjoin SOLR contrib allows external results to be joined with SOLR results in a query and the SOLR result set to be filtered by the results of an external query. Values from the external results are made available in the SOLR results and may also be used to boost the scores of corresponding documents during the search. The contrib consists of the Java classes XJoinSearchComponent and XJoinValueSourceParser, which must be configured in solrconfig.xml, and the interfaces XJoinResultsFactory and XJoinResults, which are implemented by the user to provide the link between SOLR and the external results source. External results and SOLR documents are matched via a single configurable attribute (the join field). The contrib JAR solr-xjoin-4.10.3.jar contains these classes and interfaces and should be included in SOLR's class path from solrconfig.xml, as should a JAR containing the user implementations of the previously mentioned interfaces. For example: {code:xml} config .. !-- XJoin contrib JAR file -- lib dir=${solr.install.dir:../../..}/dist/ regex=solr-xjoin-\d.*\.jar / .. !-- user implementations of XJoin interfaces -- lib path=/path/to/xjoin_test.jar / .. /config {code} h2. Java classes and interfaces h3. XJoinResultsFactory The user implementation of this interface is responsible for connecting to the external source to perform a query (or otherwise collect results). Parameters with prefix component name.external. are passed from the SOLR query URL to pararameterise the search. The interface has the following methods: * void init(NamedList args) - this is called during SOLR initialisation, and passed parameters from the search component configuration (see below) * XJoinResults getResults(SolrParams params) - this is called during a SOLR search to generate external results, and is passed parameters from the SOLR query URL (as above) For example, the implementation might perform queries of an external source based on the 'q' SOLR query URL parameter (in full, component name.external.q). h3. XJoinResults A user implementation of this interface is returned by the getResults() method of the XJoinResultsFactory implementation. It has methods: * Object getResult(String joinId) - this should return a particular result given the value of the join attribute * IterableString getJoinIds() - this should return the join attribute values for all results of the external search h3. XJoinSearchComponent This is the central Java class of the contrib. It is a SOLR search component, configured in solrconfig.xml and included in one or more SOLR request handlers. It has two main responsibilities: * Before the SOLR search, it connects to the external source and retrieves results, storing them in the SOLR request context * After the SOLR search, it matches SOLR document in the results set and external results via the join field, adding attributes from the external results to documents in the SOLR results set It takes the following initialisation parameters: * factoryClass - this specifies the user-supplied class implementing XJoinResultsFactory, used to generate external results * joinField - this specifies the attribute on which to join between SOLR documents and external results * external - this parameter set is passed to configure the XJoinResultsFactory implementation For example, in solrconfig.xml: {code:xml} searchComponent name=xjoin_test class=org.apache.solr.search.xjoin.XJoinSearchComponent str name=factoryClasstest.TestXJoinResultsFactory/str str name=joinFieldid/str lst name=external str name=values1,2,3/str /lst /searchComponent {code} Here, the search component instantiates a new TextXJoinResultsFactory during initialisation, and passes it the values parameter (1, 2, 3) to configure it. To properly use the XJoinSearchComponent in a request handler, it must be included at the start and end of the component list, and may be configured with the following query
[jira] [Commented] (SOLR-7341) xjoin - join data from external sources
[ https://issues.apache.org/jira/browse/SOLR-7341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14392905#comment-14392905 ] Tom Winch commented on SOLR-7341: - Patch file on the way. xjoin - join data from external sources --- Key: SOLR-7341 URL: https://issues.apache.org/jira/browse/SOLR-7341 Project: Solr Issue Type: New Feature Components: search Affects Versions: 4.10.3 Reporter: Tom Winch Priority: Minor Fix For: Trunk h2. XJoin The xjoin SOLR contrib allows external results to be joined with SOLR results in a query and the SOLR result set to be filtered by the results of an external query. Values from the external results are made available in the SOLR results and may also be used to boost the scores of corresponding documents during the search. The contrib consists of the Java classes XJoinSearchComponent and XJoinValueSourceParser, which must be configured in solrconfig.xml, and the interfaces XJoinResultsFactory and XJoinResults, which are implemented by the user to provide the link between SOLR and the external results source. External results and SOLR documents are matched via a single configurable attribute (the join field). The contrib JAR solr-xjoin-4.10.3.jar contains these classes and interfaces and should be included in SOLR's class path from solrconfig.xml, as should a JAR containing the user implementations of the previously mentioned interfaces. For example: {code:xml} config .. !-- XJoin contrib JAR file -- lib dir=${solr.install.dir:../../..}/dist/ regex=solr-xjoin-\d.*\.jar / .. !-- user implementations of XJoin interfaces -- lib path=/path/to/xjoin_test.jar / .. /config {code} h2. Java classes and interfaces h3. XJoinResultsFactory The user implementation of this interface is responsible for connecting to the external source to perform a query (or otherwise collect results). Parameters with prefix component name.external. are passed from the SOLR query URL to pararameterise the search. The interface has the following methods: * void init(NamedList args) - this is called during SOLR initialisation, and passed parameters from the search component configuration (see below) * XJoinResults getResults(SolrParams params) - this is called during a SOLR search to generate external results, and is passed parameters from the SOLR query URL (as above) For example, the implementation might perform queries of an external source based on the 'q' SOLR query URL parameter (in full, component name.external.q). h3. XJoinResults A user implementation of this interface is returned by the getResults() method of the XJoinResultsFactory implementation. It has methods: * Object getResult(String joinId) - this should return a particular result given the value of the join attribute * IterableString getJoinIds() - this should return the join attribute values for all results of the external search h3. XJoinSearchComponent This is the central Java class of the contrib. It is a SOLR search component, configured in solrconfig.xml and included in one or more SOLR request handlers. It has two main responsibilities: * Before the SOLR search, it connects to the external source and retrieves results, storing them in the SOLR request context * After the SOLR search, it matches SOLR document in the results set and external results via the join field, adding attributes from the external results to documents in the SOLR results set It takes the following initialisation parameters: * factoryClass - this specifies the user-supplied class implementing XJoinResultsFactory, used to generate external results * joinField - this specifies the attribute on which to join between SOLR documents and external results * external - this parameter set is passed to configure the XJoinResultsFactory implementation For example, in solrconfig.xml: {code:xml} searchComponent name=xjoin_test class=org.apache.solr.search.xjoin.XJoinSearchComponent str name=factoryClasstest.TestXJoinResultsFactory/str str name=joinFieldid/str lst name=external str name=values1,2,3/str /lst /searchComponent {code} Here, the search component instantiates a new TextXJoinResultsFactory during initialisation, and passes it the values parameter (1, 2, 3) to configure it. To properly use the XJoinSearchComponent in a request handler, it must be included at the start and end of the component list, and may be configured with the following query parameters: * results - a comma-separated list of attributes from the XJoinResults implementation (created by the factory at search time) to be included in the SOLR results * fl - a comma-separated list of attributes from results objects (contained in an