Re: Simulate facet.exists for json query facets

2020-10-30 Thread michael dürr
@Erick

Sorry! I chose a simple example as I wanted to reduce complexity.
In detail:
* We have distinct contents like tours, offers, events, etc which
themselves may be categorized: A tour may be a hiking tour, a
mountaineering tour, ...
* We have hundreds of customers that want to facet their searches to that
content types but often with distinct combinations of categories, i.e.
customer A wants his facet "tours" to only count hiking tours, customer B
only mountaineering tours, customer C a combination of both, etc
* We use "query" facets as each facet request will be build dynamically (it
is not feasible to aggregate certain categories and add them as an
additional solr schema field as we have hundreds of different combinations).
* Anyways, our ui only requires adding a toggle to filter for (for example)
"tours" in case a facet result is present. We do not care about the number
of tours.
* As we have millions of contents and dozens of content types (and dozens
of categories per content type) such queries may take a very long time.

A complex example may look like this:























































*q=*:*={   tour:{ type : query, q: \"+categoryId:(21450
21453)\"   },   guide:{ type : query, q: \"+categoryId:(21105 21401
21301 21302 21303 21304 21305 21403 21404)\"   },   story:{ type :
query, q: \"+categoryId:21515\"   },   condition:{ type : query,
 q: \"+categoryId:21514\"   },   hut:{ type : query, q:
\"+categoryId:8510\"   },   skiresort:{ type : query, q:
\"+categoryId:21493\"   },   offer:{ type : query, q:
\"+categoryId:21462\"   },   lodging:{ type : query, q:
\"+categoryId:6061\"   },   event:{ type : query, q:
\"+categoryId:21465\"   },   poi:{ type : query, q:
\"+(+categoryId:6000 -categoryId:(6061 21493 8510))\"   },   authors:{
 type : query, q: \"+categoryId:(21205 21206)\"   },   partners:{
 type : query, q: \"+categoryId:21200\"   },   list:{ type :
query, q: \"+categoryId:21481\"   } }\=0"*

@Michael

Thanks for your suggestion but this does not work as
* the facet module expects an aggregate function (which i simply added by
embracing your call with sum(...))
* and (please correct me if I am wrong) the exists() function not stops on
the first match, but counts the number of results for which the query
matches a document.


Simulate facet.exists for json query facets

2020-10-28 Thread michael dürr
Hi,

I use json facets of type 'query'. As these queries are pretty slow and I'm
only interested in whether there is a match or not, I'd like to restrict
the query execution similar to the standard facetting (like with the
facet.exists parameter). My simplified query looks something like this (in
reality *:* may be replaced by a complex edismax query and multiple
subfacets similar to "tour" occur):

curl http://localhost:8983/solr/portal/select -d \
"q=*:*\
={
  tour:{
type : query,
 q: \"+(+categoryId:6000 -categoryId:(6061 21493 8510))\"
  }
}\
=0"

Is there any possibility to modify my request to ensure that the facet
query stops as soon as it matches a hit for the first time?

Thanks!
Michael


Boolean expression for spatial query

2017-02-25 Thread Michael Dürr
Hi all,

I index documents containing a spatial field (rpt) that holds a wkt
multipolygon. In order to retrieve all documents for which a certain point
is contained within a polygon I issue the following query:

q=*:*={!field f=regionGeometry}Contains(POINT( ))

This works pretty good.

My question is: Is there any syntax to issue this query for multiple points
(i.e. return all documents for which at least one of the points is within
the document's polygon)?

E.g. something like this:

q=*:*={!field f=regionGeometry}ContainsOR(POINT( ),POINT(
),...)

If not - what other efficient options do you xuggest to do such a query?

Best regards,
Michael


solr init script won't execute under user account without login shell

2017-02-04 Thread Michael Dürr
Hello,

please apologize if this is the wrong place to file my request! (Should I
open a JIRA issue instead?)

The problem:

I'm using solr 6.3.0. In my solr setup I apply some plugin code which
requires write access to some directories which are owned by the user
"tomcat". This user has no login shell (i.e. passwd holds /bin/false).

Due to our security policies I'm not allowed to simply add the "solr" user
to the "tomcat" group (in order to provide him write access to those
directories).

The obvious solution is to install solr under user "tomcat" (i.e. execute
the solr installation script with parameter "-u tomcat")

However, due to the missing login shell I won't be able to start solr via
the standard solr init script any longer.

My temporary solution is to add the command line option "-s /bin/bash" to
the solr init script by hand.

Is there already a better way to avoid this manual modification?

If not - might it be a good idea to add an option to the installation
script in order to specify a shell?

Best regards,
Michael


update log not in ACTIVE or REPLAY state

2016-04-13 Thread michael dürr
Hello,

when I launch my two nodes in Solr cloud, I always get the following error
at node2:

PeerSync: core=portal_shard1_replica2 url=http://127.0.1.1:8984/solr ERROR,
update log not in ACTIVE or REPLAY state. FSUpdateLog{state=BUFFERING,
tlog=null}

Actually, I cannot experience any problems, but before going to production,
I wanted to know why I get this error?

I'm running two nodes (node1 and node2) in a Solr Cloud cluster (5.4.1).
node1 is started with embedded zookeeper and listens to port 8983. Node2
listens on port 8984 and registers with the embedded zookeeper of node1 at
port 9983.
I have one collection "portal" (1 shard, 2 replicas), where each node
serves one replica.
The settings for commit on both nodes are:



  ${solr.autoCommit.maxTime:15000}
  false


and


  ${solr.autoSoftCommit.maxTime:-1}


Can you give me some advise, how to get rid of this error?
Should I simply ignore it?

Thanks,
Michael


update log not in ACTIVE or REPLAY state

2016-03-31 Thread michael dürr
Hallo,

when I launch my two nodes in Solr cloud, I always get the following error
at node2:

PeerSync: core=portal_shard1_replica2 url=http://127.0.1.1:8984/solr
ERROR,​ update log not in ACTIVE or REPLAY state.
FSUpdateLog{state=BUFFERING,​ tlog=null}

Actually, I cannot experience any problems, but before going to production,
I wanted to know why I get this error?

I'm running two nodes (node1 and node2) in a Solr Cloud cluster (5.4.1).
node1 is started with embedded zookeeper and listens to port 8983. Node2
listens on port 8984 and registers with the embedded zookeeper of node1 at
port 9983.
I have one collection "portal" (1 shard, 2 replicas), where each node
serves one replica.
The settings for commit on both nodes are:



  ${solr.autoCommit.maxTime:15000}
false

and


${solr.autoSoftCommit.maxTime:-1}

Can you give me some advise, how to get rid of this error?Should I
simply ignore it?

Thanks,Michael


Custom plugin to handle proprietary binary input stream

2016-02-11 Thread michael dürr
I'm looking for an option to write a Solr plugin which can deal with a
custom binary input stream. Unfortunately Solr's javabin as a protocol is
not an option for us.

I already had a look at some possibilities like writing a custom request
handler, but it seems like the classes/interfaces one would need to
implement are not "generic" enough (e.g. the
SolrRequestHandler#handleRequest() method expects objects of classes
SolrQueryRequest and SolrQueryResponse rsp)

It would be of great help if you could direct me to any "pluggable"
solution which allows to receive and parse a proprietary binary stream at a
Solr server so that we do not have to provide an own customized binary solr
server.

Background:
Our problem is that, we use a proprietary protocol to transfer our solr
queries together with some other Java objects to our solr server (at
present 3.6).The reason for this is, that we have some logic at the solr
server which heavily depends on theses other java objects. Unfortunately we
cannot easily shift that logic to the client side.

Thank you!

Michael