Re: Using function queries for faceting

2017-04-08 Thread Georg Sorst
Hi Mikhail,

thanks, JSON facet domains may actually be the key! Something like (when a
user from group1 is searching):

1. Facet on price_group1
2. Facet on price for all results that do not have price_group1 field using
JSON facet domain
3. Sum up the facet counts

Best,

Georg
Mikhail Khludnev  schrieb am Di., 4. Apr. 2017, 17:05:

Exclude users' products, calculate default price facet, then facet only
user's products (in a main query) and sum facet counts. It's probably can
be done with switching domains in json facets.

On Tue, Apr 4, 2017 at 5:43 PM, Georg Sorst  wrote:

> Hi Mikhail,
>
> copying the default field was my first attempt as well - however, the
> system in total has over 50.000 users which may have an individual price
on
> every product (even though they usually don't). Still, with the copying
> approach this results in every document having 50.000 price fields. Solr
> completely chokes trying to import this data.
>
> Best,
> Georg
>
> Mikhail Khludnev  schrieb am Di., 4. Apr. 2017 um
> 15:28 Uhr:
>
> > Hello Georg,
> > You can probably use {!frange} and  and a few facet.query enumerating
> price
> > ranges, but probably it's easier to just copy default price across all
> > empty price groups in index time.
> >
> >
> > On Tue, Apr 4, 2017 at 1:14 PM, Georg Sorst 
> wrote:
> >
> > > Hi list!
> > >
> > > My documents are eCommerce items. They may have a special price for a
> > > certain group of users, but not for other groups of users; in that
case
> > the
> > > default price should be used. So the documents look like something
like
> > > this:
> > >
> > > item:
> > >   id: 1
> > >   price_default: 11.5
> > >   price_group1: 11.2
> > > item:
> > >   id: 2
> > >   price_default: 12.3
> > >   price_group2: 12.5
> > >
> > > Now when I want to fetch the documents and display the correct price
> for
> > > group1 I can use 'fl=def(price_group1,price_default)'. Works like a
> > charm!
> > > It will return price_group1 for document 1 and price_default for
> document
> > > 2.
> > >
> > > Is there a way to do this for faceting as well? I've unsuccessfully
> > tried:
> > >
> > > * facet.field=def(price_group1,price_default)
> > > * facet.field=effective_price:def(price_group1,price_default)
> > > * facet.field={!func}def(price_group1,price_default)
> > > * facet.field={!func}effective_price:def(price_group1,price_default)
> > > * json.facet={price:"def(price_group1,price_default)"}
> > >
> > > I'm fine with either the "old" facet API or the JSON facets.Any ideas?
> > >
> > > Thanks!
> > > Georg
> > >
> >
> >
> >
> > --
> > Sincerely yours
> > Mikhail Khludnev
> >
>



--
Sincerely yours
Mikhail Khludnev


Issue with facet count

2017-04-08 Thread kshitij tyagi
Hi,

I am getting zero count for all facets created by using facet.field in solr
5.1

The surprise element is that I am able to query correctly on fields, but my
facet counts are returning zero count.

Can anyone help me out here on what all I should check?

Regards,
Kshitij


Re: Issue with facet count

2017-04-08 Thread Alexandre Rafalovitch
What happens when you facet on a 'all document query' (q=*:*)? Are you
sure your facet fields actually have the content? If they are stored,
they should be returned with the query. If they are not stored, you
could see what they contain in the Schema screen of the Admin UI (load
tokens checkbox).

Hope that helps to narrow down the issue.

Regards,
   Alex.
P.s. I don't doubt you, but for myself, I would also do a sanity check
that I AM actually getting results because I am querying on THOSE
fields and not - say - on some other field and/or copyField target.
Enabling debug would show you exactly what fields are being querying
with what (analyzed) token.

http://www.solr-start.com/ - Resources for Solr users, new and experienced


On 8 April 2017 at 17:53, kshitij tyagi  wrote:
> Hi,
>
> I am getting zero count for all facets created by using facet.field in solr
> 5.1
>
> The surprise element is that I am able to query correctly on fields, but my
> facet counts are returning zero count.
>
> Can anyone help me out here on what all I should check?
>
> Regards,
> Kshitij


Re: Issue with facet count

2017-04-08 Thread kshitij tyagi
Hi Alex,

Thanks for the response.

1. Actually everything was working fine earlier unless I made changes on a
dynamic field whose facets are being created, I changed the field type to
"strings" earlier I was tokenizing my field on based delimeter '_'.

2. When I made the changes and started indexing then facet count started
coming zero, though I was able to query properly on facets and results were
fine but facet count was giving zero.

3. Then I reverted my changes back in schema file but my problem was not
solved and it was still giving zero facet count after reindexing.

I am unable to understand that when I have reverted my schema changes then
things should be back to normal but the case is almost opposite.

Kindly help!'
Let me know if u require any other information.


On Sat, Apr 8, 2017 at 9:00 PM, Alexandre Rafalovitch 
wrote:

> What happens when you facet on a 'all document query' (q=*:*)? Are you
> sure your facet fields actually have the content? If they are stored,
> they should be returned with the query. If they are not stored, you
> could see what they contain in the Schema screen of the Admin UI (load
> tokens checkbox).
>
> Hope that helps to narrow down the issue.
>
> Regards,
>Alex.
> P.s. I don't doubt you, but for myself, I would also do a sanity check
> that I AM actually getting results because I am querying on THOSE
> fields and not - say - on some other field and/or copyField target.
> Enabling debug would show you exactly what fields are being querying
> with what (analyzed) token.
> 
> http://www.solr-start.com/ - Resources for Solr users, new and experienced
>
>
> On 8 April 2017 at 17:53, kshitij tyagi 
> wrote:
> > Hi,
> >
> > I am getting zero count for all facets created by using facet.field in
> solr
> > 5.1
> >
> > The surprise element is that I am able to query correctly on fields, but
> my
> > facet counts are returning zero count.
> >
> > Can anyone help me out here on what all I should check?
> >
> > Regards,
> > Kshitij
>


Re: Simple sql query with where clause doesn't work

2017-04-08 Thread Joel Bernstein
Which version of Solr are you working with? Solr 6.5 has different SQL
engine the 6.0 through 6.4. Also what are field types you are working with
in the where clause?

Here is SQL query from the test cases in 6.4:
select id, Field_i, Str_s from Collection1 where Text_t='' order by
Field_i desc"

This shows a where clause with on text field.



Joel Bernstein
http://joelsolr.blogspot.com/

On Fri, Apr 7, 2017 at 3:05 PM, lazarusjohn  wrote:

> Did you find answer I getting same error when I use text instead of number
> in
> Where clause - Please let me know.
>
>
>
> --
> View this message in context: http://lucene.472066.n3.
> nabble.com/Simple-sql-query-with-where-clause-doesn-t-
> work-tp4324498p4328991.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>


Re: Issue with facet count

2017-04-08 Thread Alexandre Rafalovitch
Did you do a full reindex? Try completely deleting the index and
redoing it from scratch (at least as a test). If you have left over
documents and changed type definitions, things may get messy. If
that's too hard, just index a single record into a separate collection
with matching-definition and check there to find the difference.

A type change could be especially complicated if one type was defined
(on field OR on type) with DocValues and another one without.

Regards,
   Alex.

http://www.solr-start.com/ - Resources for Solr users, new and experienced


On 8 April 2017 at 18:42, kshitij tyagi  wrote:
> Hi Alex,
>
> Thanks for the response.
>
> 1. Actually everything was working fine earlier unless I made changes on a
> dynamic field whose facets are being created, I changed the field type to
> "strings" earlier I was tokenizing my field on based delimeter '_'.
>
> 2. When I made the changes and started indexing then facet count started
> coming zero, though I was able to query properly on facets and results were
> fine but facet count was giving zero.
>
> 3. Then I reverted my changes back in schema file but my problem was not
> solved and it was still giving zero facet count after reindexing.
>
> I am unable to understand that when I have reverted my schema changes then
> things should be back to normal but the case is almost opposite.
>
> Kindly help!'
> Let me know if u require any other information.
>
>
> On Sat, Apr 8, 2017 at 9:00 PM, Alexandre Rafalovitch 
> wrote:
>
>> What happens when you facet on a 'all document query' (q=*:*)? Are you
>> sure your facet fields actually have the content? If they are stored,
>> they should be returned with the query. If they are not stored, you
>> could see what they contain in the Schema screen of the Admin UI (load
>> tokens checkbox).
>>
>> Hope that helps to narrow down the issue.
>>
>> Regards,
>>Alex.
>> P.s. I don't doubt you, but for myself, I would also do a sanity check
>> that I AM actually getting results because I am querying on THOSE
>> fields and not - say - on some other field and/or copyField target.
>> Enabling debug would show you exactly what fields are being querying
>> with what (analyzed) token.
>> 
>> http://www.solr-start.com/ - Resources for Solr users, new and experienced
>>
>>
>> On 8 April 2017 at 17:53, kshitij tyagi 
>> wrote:
>> > Hi,
>> >
>> > I am getting zero count for all facets created by using facet.field in
>> solr
>> > 5.1
>> >
>> > The surprise element is that I am able to query correctly on fields, but
>> my
>> > facet counts are returning zero count.
>> >
>> > Can anyone help me out here on what all I should check?
>> >
>> > Regards,
>> > Kshitij
>>


SolrJ appears to have problems with Docker Toolbox

2017-04-08 Thread Mike Thomsen
I'm running two nodes of SolrCloud in Docker on Windows using Docker
Toolbox.  The problem I am having is that Docker Toolbox runs inside of a
VM and so it has an internal network inside the VM that is not accessible
to the Docker Toolbox VM's host OS. If I go to the VM's IP which is
192.168.99.100, I can load the admin UI and do basic operations that are
written to go against that IP and port (like querying, schema editor,
manually adding documents, etc.)

However, when I try to run code that uses SolrJ to add documents, it fails
because the ZK configuration has the IPs for the internal Docker network
which is 172.X.Y..Z. If I log into the toolbox VM and run the Java code
from there, it works just fine. From the host OS, doesn't.

Anyone have any ideas on how to get around this? If I rewrite the indexing
code to do a manual JSON POST to the update handler on one of the nodes, it
does work just fine, but that leaves me not using SolrJ.

Thanks,

Mike


Re: SolrJ appears to have problems with Docker Toolbox

2017-04-08 Thread Rick Leir
Hi Mike
Did you dockerize Solr yourself? I have some knowledge of Docker, and think 
that this question would get better help in a Docker forum.
Cheers -- Rick

On April 8, 2017 8:42:13 PM EDT, Mike Thomsen  wrote:
>I'm running two nodes of SolrCloud in Docker on Windows using Docker
>Toolbox.  The problem I am having is that Docker Toolbox runs inside of
>a
>VM and so it has an internal network inside the VM that is not
>accessible
>to the Docker Toolbox VM's host OS. If I go to the VM's IP which is
>192.168.99.100, I can load the admin UI and do basic operations that
>are
>written to go against that IP and port (like querying, schema editor,
>manually adding documents, etc.)
>
>However, when I try to run code that uses SolrJ to add documents, it
>fails
>because the ZK configuration has the IPs for the internal Docker
>network
>which is 172.X.Y..Z. If I log into the toolbox VM and run the Java code
>from there, it works just fine. From the host OS, doesn't.
>
>Anyone have any ideas on how to get around this? If I rewrite the
>indexing
>code to do a manual JSON POST to the update handler on one of the
>nodes, it
>does work just fine, but that leaves me not using SolrJ.
>
>Thanks,
>
>Mike

-- 
Sorry for being brief. Alternate email is rickleir at yahoo dot com 

Re: SolrJ appears to have problems with Docker Toolbox

2017-04-08 Thread Mike Thomsen
Hi Rick,

No, I just used the "official" one on Docker Hub (
https://hub.docker.com/_/solr/) and followed the instructions for linking
and working with ZooKeeper to get SolrCloud up and running.

I may have to go to the Docker forum in the end, but I thought I'd ask here
first since the only thing that seems to be broken is the Java client API,
not the servers, in this environment/configuration.

Thanks,

Mike

On Sat, Apr 8, 2017 at 9:41 PM, Rick Leir  wrote:

> Hi Mike
> Did you dockerize Solr yourself? I have some knowledge of Docker, and
> think that this question would get better help in a Docker forum.
> Cheers -- Rick
>
> On April 8, 2017 8:42:13 PM EDT, Mike Thomsen 
> wrote:
> >I'm running two nodes of SolrCloud in Docker on Windows using Docker
> >Toolbox.  The problem I am having is that Docker Toolbox runs inside of
> >a
> >VM and so it has an internal network inside the VM that is not
> >accessible
> >to the Docker Toolbox VM's host OS. If I go to the VM's IP which is
> >192.168.99.100, I can load the admin UI and do basic operations that
> >are
> >written to go against that IP and port (like querying, schema editor,
> >manually adding documents, etc.)
> >
> >However, when I try to run code that uses SolrJ to add documents, it
> >fails
> >because the ZK configuration has the IPs for the internal Docker
> >network
> >which is 172.X.Y..Z. If I log into the toolbox VM and run the Java code
> >from there, it works just fine. From the host OS, doesn't.
> >
> >Anyone have any ideas on how to get around this? If I rewrite the
> >indexing
> >code to do a manual JSON POST to the update handler on one of the
> >nodes, it
> >does work just fine, but that leaves me not using SolrJ.
> >
> >Thanks,
> >
> >Mike
>
> --
> Sorry for being brief. Alternate email is rickleir at yahoo dot com


Tagging Locations using SynonymGraphFilterFactory

2017-04-08 Thread marotosg
Hi,

I am trying to extract locations from a location field which contains
location information in different formats. My initial idea is to extract
only UK and USA location and get them Standard.

For instance if my field contains "Wakefield" then I will convert it to
"Wakefield West Yorkshire".
After that my new field will be a facet field with standard locations. 

I am trying to achieve this with the new SynonymGraphFilterFactory but waht
I get after applying it is a list of tokens like that.
Wakefield (1)
West (1)
Yorkshire (1).

How is it possible to get all the tokens as one Wakefield West Yorkshire(1).

Here is the analyzer field definition

 

 



thanks



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Tagging-Locations-using-SynonymGraphFilterFactory-tp4329089.html
Sent from the Solr - User mailing list archive at Nabble.com.