Re: [SOLVED] UPDATE collection's Rule-based Replica Placement

2021-02-17 Thread mosheB
Thanks Ilan and Aroop for replying.
So not exactly move but rather *update* the existing set of rules so future
replica placement will enforced by them.
I managed to do so using the  MODIFYCOLLECTION

  
action:

http://:/solr/admin/collections?action=MODIFYCOLLECTION==shard:*,replica:<2,host:*



--
Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html


UPDATE collection's Rule-based Replica Placement

2021-02-09 Thread mosheB
Hi community,
Using Solr 8.3, is there any way to change the replica placment of "running"
collection say "from this point forward" or should I recreate the collection
and migrate all my data from the existing collection to the new one?
Tried to use the COLLECTIONPROP action which doesn't do the job, instead it
just update collectionprops.json file and not really affect the replica
placement enforcement.
 
Thanks!



--
Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html


Re: Leading wildcard searches very slow

2021-01-19 Thread mosheB
Hi, is there any sophisticated way [using the schema] to block brutal regex
queries?


Thanks



--
Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html


Highlighting values of non stored fields

2020-06-02 Thread mosheB
Our use case is as follow:
We are indexing free text documents. Each document contains metadata fields
(such as author, creation date...) which are kinda small, and one "big"
field that holds the document's text itself.

For ranking purpose each field is indexed in more then one "variation" and
query is executed with edismax query parser. Things are working alright, but
now a new feature is requested by the customer - highlighting.
To enable highlighting every field must be stored, including all variations
of the big text field. This pushes our storage to the limit (and probably
the document cache...) and feels a bit redundant, as the stored value is
duplicated n times... Is there any way to “reference” stored value from one
field to another?
For example:
Say we have the following config:







And we execute the following query:
http://.../select?defType=edismax=desired_terms=doc_text^2
doc_text_bigrams^3
doc_text_phrases^4=on=doc_text,doc_text_bigrams,doc_text_phrases

Highlight fragments in response will be blank if match occurred  on the
non-stored fields (doc_text_bigrams or doc_text_phrases). Is it possible to
pass extra parameter to the highlight component, to point it to the stored
data of the “original” doc_text field? a kind of “stored value reference
field”?

Thanks in advance.



--
Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html


Reading authenticated user value inside custom DocTransformer

2020-02-03 Thread mosheB
We are using Solr's kerberos authentication plugin and we are trying to
implement field-level filtering based on the authenticated user and
DocTransformer class:

public class FieldAclTransformerFactory extends TransformerFactory {
@Override
public DocTransformer create(String field, SolrParams params,
SolrQueryRequest req) {
String user = req.getUserPrincipal().getName();
return new FieldAclTransformer(user);
}
}

public class FieldAclTransformer extends DocTransformer {
String user;
public FieldAclTransformer(String user) {
this.user = user;
}

@Override
public void transform(SolrDocument doc, int docid, float score) {
//filter fields according to applicative logic, based on the 
authenticated
user.
}
}

For simplicity, we do not use authorization plugin (here is our complete
security.json file):
{
"authentication":{
"class": "org.apache.solr.security.KerberosPlugin"
}
}

During develop phase plugin was tested against collection with single shard
and everything worked as expected (Solr 8.3.1).
After moving to production, plugin failed. During debug we saw that the
reason is that SOME shards were getting incorrect user from
/req.getUserPrincipal().getName()/: instead of the ORIGINAL user, Solr's SPN
is returned.
Our best guess is that failing requests are the distributed requests (the
requests the are routed from the node that received the original request),
and indeed, if we add `/distrib=false/` to our request plugin wasnt failing.

So, back to the question... is this a bug in solr, or is that just not way
we suppose to get the authenticated user?
Thanks.



--
Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html


Getting authenticated user inside DocTransformer plugin

2020-02-03 Thread mosheB
We are using Solr's kerberos authentication plugin and we are trying to
implement field-level filtering based on the authenticated user and
DocTransformer class:

public class FieldAclTransformerFactory extends TransformerFactory {
@Override
public DocTransformer create(String field, SolrParams params,
SolrQueryRequest req) {
String user = req.getUserPrincipal().getName();
return new FieldAclTransformer(user);
}
}
//
public class FieldAclTransformer extends DocTransformer {
String user;
public FieldAclTransformer(String user) {
this.user = user;
}

@Override
public void transform(SolrDocument doc, int docid, float score) {
//filter fields according to applicative logic, based on the 
authenticated
user.
}
}

For simplicity, we do not use authorization plugin (here is our complete
security.json file):
{
"authentication":{
"class": "org.apache.solr.security.KerberosPlugin"
}
}

During develop phase plugin was tested against collection with single shard
and everything worked as expected (Solr 8.3.1).
After moving to production, plugin failed. During debug we saw that the
reason is that SOME shards were getting incorrect user from
/req.getUserPrincipal().getName()/: instead of the ORIGINAL user, Solr's SPN
is returned.
Our best guess is that failing requests are the distributed requests (the
requests the are routed from the node that received the original request),
and indeed, if we add `/distrib=false/` to our request plugin wasnt failing.

So, back to the question... is this a bug in solr, or is that just not way
we suppose to get the authenticated user?
Thanks.



--
Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html


Configuring load balancer for Kerberised Solr cluster

2018-06-26 Thread mosheB
We are trying to enable authentication mechanism in our Solr cluster using
Kerberos authentication plugin. We use Active Directory as our KDC, each
Solr node has its own SPN in the form of HTTP/@ and things are
working as expected.
Things are getting complicated while trying to configure our load balancer,
as there is no specific SPN to ask the KDC a ticket for (the balancer is
routing to multiple SPNs...)
As a solution we though to add the balancer's principal to each of the Solr
nodes (and to the keytab files of course) as follow:

-Dsolr.kerberos.principal=HTTP/solr_host.our.domain@OUR.REALM,HTTP/balancer_host.our.domain@OUR.REALM

But it seems impossible to config Solr with more than one SPN.
Is there any other workaround?






--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html