How use sort parent documents by a child document's field with specific _nest_path?

2022-11-26 Thread Chatree Srichart
Hello all,

I have these 2 parent documents and each of them has 2 children with
different nest paths (/path1, and /path2)

[
{
"id": "parent_1",
"children": [
{
"id": "child_1.1",
"field": "value 1.1",
"_nest_path_": "/path1#"
},
{
"id": "child_1.2",
"field": "value 1.2",
"_nest_path_": "/path2#"
}
]
},
{
"id": "parent_2",
"children": [
{
"id": "child_2.1",
"field": "value 2.1",
"_nest_path_": "/path1#"
},
{
"id": "child_2.2",
"field": "value 2.2",
"_nest_path_": "/path2#"
}
]
}
]


My question is:

How to sort the parent documents by a field of a child document with
specific _nest_path?

I see this in the Solr document:

sort=childfield(field,{!parent of=…}…) desc allows to inline block join
parent query


*childfield(field) Function*
https://solr.apache.org/guide/8_11/function-queries.html

However, I don't know what the of=... should be.

I have already tried this:

childfield(field,{!parent of='_nest_path_=/path1'}) desc

but I always get this error:

*Can't determine a Sort Order (asc or desc) in sort spec ...*

Best regards,
Chatree Srichart


Re: How use sort parent documents by a child document's field with specific _nest_path?

2022-11-26 Thread Mikhail Khludnev
Hello, Chatree.
Please check about `of` param
https://solr.apache.org/guide/solr/latest/query-guide/block-join-query-parser.html#block-mask
It's really important note.
I've made childfield() myself, so I can consult about it, but I don't know
is those _nest_path. Unfortunately I'm unaware of them.
Note, lucene query syntax uses colon to separate field:text, not =.
That {!parent} query lacks a subordinate children query, ie. it should go
after closing curly bracket } of before it via ... v='field:val'}.
Pls keep us posted if you figure out the solution.

On Sat, Nov 26, 2022 at 12:38 PM Chatree Srichart <
chatree.srich...@gmail.com> wrote:

> Hello all,
>
> I have these 2 parent documents and each of them has 2 children with
> different nest paths (/path1, and /path2)
>
> [
> {
> "id": "parent_1",
> "children": [
> {
> "id": "child_1.1",
> "field": "value 1.1",
> "_nest_path_": "/path1#"
> },
> {
> "id": "child_1.2",
> "field": "value 1.2",
> "_nest_path_": "/path2#"
> }
> ]
> },
> {
> "id": "parent_2",
> "children": [
> {
> "id": "child_2.1",
> "field": "value 2.1",
> "_nest_path_": "/path1#"
> },
> {
> "id": "child_2.2",
> "field": "value 2.2",
> "_nest_path_": "/path2#"
> }
> ]
> }
> ]
>
>
> My question is:
>
> How to sort the parent documents by a field of a child document with
> specific _nest_path?
>
> I see this in the Solr document:
>
> sort=childfield(field,{!parent of=…}…) desc allows to inline block join
> parent query
>
>
> *childfield(field) Function*
> https://solr.apache.org/guide/8_11/function-queries.html
>
> However, I don't know what the of=... should be.
>
> I have already tried this:
>
> childfield(field,{!parent of='_nest_path_=/path1'}) desc
>
> but I always get this error:
>
> *Can't determine a Sort Order (asc or desc) in sort spec ...*
>
> Best regards,
> Chatree Srichart
>


-- 
Sincerely yours
Mikhail Khludnev


Announcing {!mlt_content} Re: MoreLikeThis with externally supplied text, and facets?

2022-11-26 Thread Mikhail Khludnev
Hi,
I've made {!mlt_content} accepting external content in cloud mode. See
https://issues.apache.org/jira/browse/SOLR-16420
It will be released at 9.2. Meanwhile, you can check it in snapshot like
https://ci-builds.apache.org/job/Solr/job/Solr-Artifacts-9x/lastStableBuild/artifact/solr/packaging/build/distributions/
https://ci-builds.apache.org/job/Solr/job/Solr-Artifacts-9x/322/artifact/solr/packaging/build/distributions/solr-9.2.0-jenkins322.tgz

It works on techproducts example like
q={!mlt_content qf=name mindf=0 mintf=0}SDRAM Unbuffered

On Wed, Sep 28, 2022 at 5:32 PM Mikhail Khludnev  wrote:

> I think https://github.com/apache/solr/pull/1045 is ready. Reviews are
> welcome.
>
> On Tue, Sep 20, 2022 at 12:15 PM Mikhail Khludnev  wrote:
>
>> For reference, the trick above doesn't work now, I'll work on it under
>> https://issues.apache.org/jira/browse/SOLR-16420.
>> Note, that fix for facet support in /mlt handler will be released under
>> 9.1.
>>
>> On Fri, Sep 9, 2022 at 2:37 PM Mikhail Khludnev  wrote:
>>
>>> Hold on. JSON query DSL lets you pass quite long content via body. It
>>> should support {!mlt}. At least it's worth a try.!
>>>
>>> On Thu, Sep 8, 2022 at 2:53 PM Mikhail Khludnev  wrote:
>>>
 Hello Batanun
 I checked {!mlt} source code. It can't swallow external content. I've
 found that Lucene XML parser
 https://lucene.apache.org/core/9_1_0/queryparser/org/apache/lucene/queryparser/xml/CorePlusQueriesParser.html
 is capable to handle . However, it's diverged and not
 available in Solr out-of-the-box
 https://solr.apache.org/guide/8_8/other-parsers.html#xml-query-parser


 On Thu, Sep 8, 2022 at 1:16 PM Batanun B  wrote:

> Hi,
>
> I'm evaluating if the MoreLikeThis (mlt) feature of solr can be useful
> for our editors when they are creating new content. We want to trigger 
> this
> before the content has been inserted in the system, so there is no 
> document
> in solr that we can use as a base for the mlt search. So we want to use 
> the
> "externally supplied text" feature, where we provide the article text in
> the request body of the search. This works great when we use the mlt
> request handler (/mlt). But we also would like to get facets for this
> search, and bug SOLR-7883 is stopping us from doing that.
>
> Some people suggest that we use the mlt query parser instead, as part
> of our regular request parser (/select). But I can't get that to work
> together with the "externally supplied text". It gives me the error "Bad
> contentType for search handler :text/plain".
>
> So, does anyone know how to do a search that uses MoreLikeThis with
> externally supplied text, and facets at the same time?
>
> Regards
>
>

 --
 Sincerely yours
 Mikhail Khludnev

>>>
>>>
>>> --
>>> Sincerely yours
>>> Mikhail Khludnev
>>>
>>
>>
>> --
>> Sincerely yours
>> Mikhail Khludnev
>>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>


-- 
Sincerely yours
Mikhail Khludnev


Re: Is there a way to run the entire payload of a request through a charFilter and not just the fields?

2022-11-26 Thread Mikhail Khludnev
Hi Matthew.
Can it be
https://solr.apache.org/guide/solr/latest/configuration-guide/script-update-processor.html
?

On Sat, Nov 26, 2022 at 1:15 AM Matthew Castrigno  wrote:

> I need to filter out some characters in a payload so that SOLR will
> recognize the payload as a JSON document.
>
> The solr.MappingCharFilterFactory functionality is what I need but I need
> to run over the entire payload and not just the fields.
>
> I cannot change the payload prior to submitting to SOLR.
>
> Is there any way to accomplish this?
>
> Any insights are most appreciated.
>
> Thank you.
>
> --
> "This message is intended for the use of the person or entity to which it
> is addressed and may contain information that is confidential or
> privileged, the disclosure of which is governed by applicable law. If the
> reader of this message is not the intended recipient, you are hereby
> notified that any dissemination, distribution, or copying of this
> information is strictly prohibited. If you have received this message by
> error, please notify us immediately and destroy the related message."
>


-- 
Sincerely yours
Mikhail Khludnev


Solr create collections on different servers

2022-11-26 Thread Aravind Reddy Jangam
Hi All

I started solr in cloud mode & ran below command to create collection
./solr create_collection -c doc1 -s 4 -rf 2 -force

I noticed all cores are created in same server
can you please share process to create cores on different server, I would like 
each shard data to be on separate server
Currently after creating collection all shards on same server

ls -l /opt/solr/data/
drwxr-xr-x 3 root root   41 Nov 27 02:39 doc1_shard1_replica_n12
drwxr-xr-x 3 root root   41 Nov 27 02:39 doc1_shard1_replica_n5
drwxr-xr-x 3 root root   41 Nov 27 02:39 doc1_shard2_replica_n11
drwxr-xr-x 3 root root   41 Nov 27 02:39 doc1_shard2_replica_n6
drwxr-xr-x 3 root root   41 Nov 27 02:39 doc1_shard3_replica_n14
drwxr-xr-x 3 root root   41 Nov 27 02:39 doc1_shard3_replica_n9
drwxr-xr-x 3 root root   41 Nov 27 02:39 doc1_shard4_replica_n1
drwxr-xr-x 3 root root   41 Nov 27 02:39 doc1_shard4_replica_n3

Confidentiality note: This e-mail may contain confidential information from 
Clarivate. If you are not the intended recipient, be aware that any disclosure, 
copying, distribution or use of the contents of this e-mail is strictly 
prohibited. If you have received this e-mail in error, please delete this 
e-mail and notify the sender immediately.