Gleb Arkhipov created SOLR-15821:
------------------------------------

             Summary: Add an ability to do "join" so values of "from" field are 
managed as phrases for "to" field
                 Key: SOLR-15821
                 URL: https://issues.apache.org/jira/browse/SOLR-15821
             Project: Solr
          Issue Type: Improvement
      Security Level: Public (Default Security Level. Issues are Public)
          Components: query, query parsers
    Affects Versions: 8.10
            Reporter: Gleb Arkhipov


I have 2 cores: *core_a* and *core_b*
*document_a_1* and *document_a_2* are indexed in *core_a*
{code:java}
[
 {
  "id":1,
  "name": "document_a_1",
  "field_a": "Strange name for human being"
 },
 {
  "id":2,
  "name": "document_a_2",
  "field_a": "Strange name for human"
 }
] {code}
*document_b* is indexed in *core_b*
{code:java}
{
 "id": 1,
 "name": "document_b",
 "field_b": "human being"
} {code}
I would like to find in *core_a* all documents that *field_a* contains 
*field_b* values of documents that *name* equals *document_b*
So with SQL it would like this:
{code:java}
SELECT *
FROM core_a
JOIN core_b
ON name = "document_b" AND "field_a" like "%" + field_b + "%" {code}


I suggest that the following *join* query should help me:
{code:java}
POST http://localhost:8983/solr/core_a/select
{
 "query": {
   "join": {
   "from": "field_b",
   "to": "field_a",
   "fromIndex": "core_b",
   "query": "name:document_b"
   },
 },
 "fields": "name"
}{code}
So I expect that only *document_a_1* will be returned


If *StandardTokenizerFactory* is used for both *field_a* and {*}field_b{*}, 
then response contains *document_a_1* and *document_a_2*
If *StandardTokenizerFactory* is used for *field_a* and 
*KeywordTokenizerFactory* is used for {*}field_b{*}, then the response contains 
no documents

How could I get the expected result by using join?



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to