Re: Filter Facet Query

2017-04-17 Thread Furkan KAMACI
First problem is they do not match with main query.

18 Nis 2017 Sal, saat 01:54 tarihinde Dave 
şunu yazdı:

> Min.count is what you're looking for to get non 0 facets
>
> > On Apr 17, 2017, at 6:51 PM, Furkan KAMACI 
> wrote:
> >
> > My query:
> >
> > /select?facet.field=research=on=content:test
> >
> > Q1) Facet returns research values with 0 counts which has a research
> value
> > that is not from a document matched by main query (content:test). Is that
> > usual?
> >
> > Q2) I want to filter out research values with empty string ("") from
> facet
> > result. How can I do that?
> >
> > Kind Regards,
> > Furkan KAMACI
>


Re: Solr Child="true" flag in version 6.4

2017-04-17 Thread donjose
I am getting flat structure.
Expected Result : 
{ 
 Category : "Shirt", 
 CategoryId : 1 
 Categoryvalues : [ 
 { 
 id : 1, 
 size : XL, 
color : red 
 }, 
 { 
 id : 2, 
 size : XL, 
color : blue 
 } 
 
 ] 
}

Result i am getting: 
 Categoryvalues :  
 { 
 id : 1, 
 Category : "Shirt", 
 CategoryId : 1,
 size : XL, 
 color : red 
 }
, 
 {
 id : 2, 
 Category : "Shirt", 
 CategoryId : 1,
 size : XL, 
color : blue 
 }



Data-config.xml
===













 



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Child-true-flag-in-version-6-4-tp4330312p4330437.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: field with stored="false" is still stored

2017-04-17 Thread Maria Muslea
Thank you so much. This is the setting that I was missing. It is working as
expected now.

Maria

On Mon, Apr 17, 2017 at 8:10 PM, Shawn Heisey  wrote:

> On 4/17/2017 4:40 PM, Maria Muslea wrote:
> > I just upgraded to SOLR 6.4.1 from SOLR 4.10, and am having trouble with
> > fields set as stored="false".
> >
> > I edited solrconfig.xml according to the documentation, so I could edit
> the schema using schema api.
> >
> > 
> >true
> >managed-schema
> >  
> >
> > I added a field using "Add Field" from the Schema GUI, and the field
> does appear in managed-schema as:
> >
> > 
>
> In newer versions of Solr, certain field classes have docValues enabled
> by default.  I think StrField is one of them.  I tried to look at the
> code to verify this, but was unable to figure it out on short notice.
>
> Fields with docValues enabled will show up in search results even if the
> field is not stored, unless you disable the
> |useDocValuesAsStored|setting on the field.
>
> Thanks,
> Shawn
>
>


Re: field with stored="false" is still stored

2017-04-17 Thread Maria Muslea
One additional detail. In the Schema view the field appears as "unstored
field", which is what I want, but still it seems to be stored.

Thank you for your help.


Field: concept
Field-Type:org.apache.solr.schema.StrFieldDocs:1

Flags:IndexedDocValuesOmit NormsOmit Term Frequencies & PositionsSort
Missing Last
Properties √ √ √ √ √
Schema √ √ √ √ √
Index (unstored field)


On Mon, Apr 17, 2017 at 7:33 PM, Zheng Lin Edwin Yeo 
wrote:

> Hi Maria,
>
> From what you mentioned, you have upgraded directly from Solr 4 to Solr 6.
> If I'm not wrong, I don't think we can upgrade the index with a direct jump
> of 2 version.
>
> Was the field set to stored="false" before you upgrade?
>
> Regards,
> Edwin
>
>
>
> On 18 April 2017 at 06:40, Maria Muslea  wrote:
>
> > Hi,
> >
> >
> > I just upgraded to SOLR 6.4.1 from SOLR 4.10, and am having trouble with
> > fields set as stored="false".
> >
> >
> > I edited solrconfig.xml according to the documentation, so I could edit
> the
> > schema using schema api.
> >
> >
> > 
> >true
> >managed-schema
> >  
> >
> > I added a field using "Add Field" from the Schema GUI, and the field does
> > appear in managed-schema as:
> >
> >
> > 
> >
> >
> > Once I add a document to SOLR I am able to retrieve this field even
> though
> > it is set to stored="false", which means that it is stored.
> >
> >
> > I found a comment suggesting to remove
> > AddSchemaFieldsUpdateProcessorFactory so the field isn't readded, but
> with
> > no success.
> >
> >
> > I would appreciate any help.
> >
> > Thank you,
> > Maria
> >
>


Re: field with stored="false" is still stored

2017-04-17 Thread Shawn Heisey
On 4/17/2017 4:40 PM, Maria Muslea wrote:
> I just upgraded to SOLR 6.4.1 from SOLR 4.10, and am having trouble with
> fields set as stored="false".
>
> I edited solrconfig.xml according to the documentation, so I could edit the 
> schema using schema api.
>
> 
>true
>managed-schema
>  
>
> I added a field using "Add Field" from the Schema GUI, and the field does 
> appear in managed-schema as:
>
> 

In newer versions of Solr, certain field classes have docValues enabled
by default.  I think StrField is one of them.  I tried to look at the
code to verify this, but was unable to figure it out on short notice.

Fields with docValues enabled will show up in search results even if the
field is not stored, unless you disable the
|useDocValuesAsStored|setting on the field.

Thanks,
Shawn



Re: field with stored="false" is still stored

2017-04-17 Thread Maria Muslea
Thank you for replying. While I did say "upgrade", I started with a "fresh"
copy of Solr 6.4.1, I did not try to import anything from Solr 4. Once I
saw that it isn't working as expected I only added one test document using
SolrJ:

SolrInputDocument p = new SolrInputDocument();

p.addField( "id", "id1");

p.addField( "concept", "stuff1");


Even though "concept" is set as stored="false" I can still retrieve it.


"response":{"numFound":1,"start":0,"docs":[ { "id":"id1", "concept":"stuff1",
"_version_":1564943864084561920}] }}



If you have any suggestions of what I could try I would really appreciate
it. Given what I described in my previous email is it possible that it is
not using managed-schema? Is there a why that I could see which schema it
is using?

Thank you,
Maria



On Mon, Apr 17, 2017 at 7:33 PM, Zheng Lin Edwin Yeo 
wrote:

> Hi Maria,
>
> From what you mentioned, you have upgraded directly from Solr 4 to Solr 6.
> If I'm not wrong, I don't think we can upgrade the index with a direct jump
> of 2 version.
>
> Was the field set to stored="false" before you upgrade?
>
> Regards,
> Edwin
>
>
>
> On 18 April 2017 at 06:40, Maria Muslea  wrote:
>
> > Hi,
> >
> >
> > I just upgraded to SOLR 6.4.1 from SOLR 4.10, and am having trouble with
> > fields set as stored="false".
> >
> >
> > I edited solrconfig.xml according to the documentation, so I could edit
> the
> > schema using schema api.
> >
> >
> > 
> >true
> >managed-schema
> >  
> >
> > I added a field using "Add Field" from the Schema GUI, and the field does
> > appear in managed-schema as:
> >
> >
> > 
> >
> >
> > Once I add a document to SOLR I am able to retrieve this field even
> though
> > it is set to stored="false", which means that it is stored.
> >
> >
> > I found a comment suggesting to remove
> > AddSchemaFieldsUpdateProcessorFactory so the field isn't readded, but
> with
> > no success.
> >
> >
> > I would appreciate any help.
> >
> > Thank you,
> > Maria
> >
>


Re: field with stored="false" is still stored

2017-04-17 Thread Zheng Lin Edwin Yeo
Hi Maria,

>From what you mentioned, you have upgraded directly from Solr 4 to Solr 6.
If I'm not wrong, I don't think we can upgrade the index with a direct jump
of 2 version.

Was the field set to stored="false" before you upgrade?

Regards,
Edwin



On 18 April 2017 at 06:40, Maria Muslea  wrote:

> Hi,
>
>
> I just upgraded to SOLR 6.4.1 from SOLR 4.10, and am having trouble with
> fields set as stored="false".
>
>
> I edited solrconfig.xml according to the documentation, so I could edit the
> schema using schema api.
>
>
> 
>true
>managed-schema
>  
>
> I added a field using "Add Field" from the Schema GUI, and the field does
> appear in managed-schema as:
>
>
> 
>
>
> Once I add a document to SOLR I am able to retrieve this field even though
> it is set to stored="false", which means that it is stored.
>
>
> I found a comment suggesting to remove
> AddSchemaFieldsUpdateProcessorFactory so the field isn't readded, but with
> no success.
>
>
> I would appreciate any help.
>
> Thank you,
> Maria
>


Re: Using BasicAuth with SolrJ Code

2017-04-17 Thread Zheng Lin Edwin Yeo
I'm using Solr 6.4.2.

The JARs from SolrJ which I'm using are also from Solr 6.4.2.

Regards,
Edwin


On 18 April 2017 at 08:05, Noble Paul  wrote:

> I tested this with the
>
> following code
>
> SolrRequest req = new QueryRequest(new SolrQuery("*:*"));//create a new
> req.setBasicAuthCredentials("solr", "SolrRocks");
> client.setDefaultCollection(COLLECTION);
> NamedList res = cluster.getSolrClient().request(req);
> System.out.println("successful"+ Utils.toJSON(res.asMap(5)));
>
> seems to work for me.
>
> which version of Solr and SolrJ are you using
>
> On Sun, Apr 16, 2017 at 11:40 AM, Zheng Lin Edwin Yeo
>  wrote:
> > Ok, thank you.
> >
> > Regards,
> > Edwin
> >
> > On 15 April 2017 at 08:05, Noble Paul  wrote:
> >
> >> I'll test with this and let you know
> >>
> >> On Apr 13, 2017 23:06, "Zheng Lin Edwin Yeo" 
> wrote:
> >>
> >> > The security.json which I'm using is the default one that is available
> >> from
> >> > the Solr Documentation https://cwiki.apache.org/confluence/display/
> >> > solr/Basic+Authentication+Plugin.
> >> >
> >> > {
> >> > "authentication":{
> >> >"blockUnknown": true,
> >> >"class":"solr.BasicAuthPlugin",
> >> >"credentials":{"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+
> z1oBbnQdiVC3otuq0=
> >> > Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="}
> >> > },
> >> > "authorization":{
> >> >"class":"solr.RuleBasedAuthorizationPlugin",
> >> >"user-role":{"solr":"admin"},
> >> >"permissions":[{"name":"security-edit",
> >> >   "role":"admin"}]
> >> > }}
> >> >
> >> >
> >> > Regards,
> >> > Edwin
> >> >
> >> > On 13 April 2017 at 19:53, Noble Paul  wrote:
> >> >
> >> > > That looks good. can you share the security.json (commenting out
> >> > > anything that's sensitive of course)
> >> > >
> >> > > On Wed, Apr 12, 2017 at 5:10 PM, Zheng Lin Edwin Yeo
> >> > >  wrote:
> >> > > > This is what I get when I run the code.
> >> > > >
> >> > > > org.apache.solr.client.solrj.impl.HttpSolrClient$
> >> RemoteSolrException:
> >> > > Error
> >> > > > from server at http://localhost:8983/solr/testing: Expected mime
> >> type
> >> > > > application/octet-stream but got text/html. 
> >> > > > 
> >> > > > 
> >> > > > Error 401 require authentication
> >> > > > 
> >> > > > HTTP ERROR 401
> >> > > > Problem accessing /solr/testing/update. Reason:
> >> > > > require authentication
> >> > > > 
> >> > > > 
> >> > > >
> >> > > > at
> >> > > > org.apache.solr.client.solrj.impl.HttpSolrClient.
> >> > > executeMethod(HttpSolrClient.java:578)
> >> > > > at
> >> > > > org.apache.solr.client.solrj.impl.HttpSolrClient.request(
> >> > > HttpSolrClient.java:279)
> >> > > > at
> >> > > > org.apache.solr.client.solrj.impl.HttpSolrClient.request(
> >> > > HttpSolrClient.java:268)
> >> > > > at org.apache.solr.client.solrj.SolrRequest.process(
> >> > > SolrRequest.java:149)
> >> > > > at org.apache.solr.client.solrj.SolrClient.add(SolrClient.
> java:106)
> >> > > > at org.apache.solr.client.solrj.SolrClient.add(SolrClient.
> java:71)
> >> > > > at org.apache.solr.client.solrj.SolrClient.add(SolrClient.
> java:85)
> >> > > > at testing.indexing(testing.java:2939)
> >> > > > at testing.main(testing.java:329)
> >> > > > Exception in thread "main"
> >> > > > org.apache.solr.client.solrj.impl.HttpSolrClient$
> >> RemoteSolrException:
> >> > > Error
> >> > > > from server at http://localhost:8983/solr/testing: Expected mime
> >> type
> >> > > > application/octet-stream but got text/html. 
> >> > > > 
> >> > > > 
> >> > > > Error 401 require authentication
> >> > > > 
> >> > > > HTTP ERROR 401
> >> > > > Problem accessing /solr/testing/update. Reason:
> >> > > > require authentication
> >> > > > 
> >> > > > 
> >> > > >
> >> > > > at
> >> > > > org.apache.solr.client.solrj.impl.HttpSolrClient.
> >> > > executeMethod(HttpSolrClient.java:578)
> >> > > > at
> >> > > > org.apache.solr.client.solrj.impl.HttpSolrClient.request(
> >> > > HttpSolrClient.java:279)
> >> > > > at
> >> > > > org.apache.solr.client.solrj.impl.HttpSolrClient.request(
> >> > > HttpSolrClient.java:268)
> >> > > > at org.apache.solr.client.solrj.SolrRequest.process(
> >> > > SolrRequest.java:149)
> >> > > > at org.apache.solr.client.solrj.SolrClient.commit(SolrClient.
> >> java:484)
> >> > > > at org.apache.solr.client.solrj.SolrClient.commit(SolrClient.
> >> java:463)
> >> > > > at testing.indexing(testing.java:3063)
> >> > > > at testing.main(testing.java:329)
> >> > > >
> >> > > > Regards,
> >> > > > Edwin
> >> > > >
> >> > > >
> >> > > > On 12 April 2017 at 14:28, Noble Paul 
> wrote:
> >> > > >
> >> > > >> can u paste the stacktrace here
> >> > > >>
> >> > > >> On Tue, Apr 11, 2017 at 1:19 PM, Zheng Lin Edwin Yeo
> >> > > >>  wrote:
> >> > > >> > I found from StackOverflow  that we should declare it this way:
> >> > > >> > 

Re: Using BasicAuth with SolrJ Code

2017-04-17 Thread Noble Paul
I tested this with the

following code

SolrRequest req = new QueryRequest(new SolrQuery("*:*"));//create a new
req.setBasicAuthCredentials("solr", "SolrRocks");
client.setDefaultCollection(COLLECTION);
NamedList res = cluster.getSolrClient().request(req);
System.out.println("successful"+ Utils.toJSON(res.asMap(5)));

seems to work for me.

which version of Solr and SolrJ are you using

On Sun, Apr 16, 2017 at 11:40 AM, Zheng Lin Edwin Yeo
 wrote:
> Ok, thank you.
>
> Regards,
> Edwin
>
> On 15 April 2017 at 08:05, Noble Paul  wrote:
>
>> I'll test with this and let you know
>>
>> On Apr 13, 2017 23:06, "Zheng Lin Edwin Yeo"  wrote:
>>
>> > The security.json which I'm using is the default one that is available
>> from
>> > the Solr Documentation https://cwiki.apache.org/confluence/display/
>> > solr/Basic+Authentication+Plugin.
>> >
>> > {
>> > "authentication":{
>> >"blockUnknown": true,
>> >"class":"solr.BasicAuthPlugin",
>> >"credentials":{"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0=
>> > Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="}
>> > },
>> > "authorization":{
>> >"class":"solr.RuleBasedAuthorizationPlugin",
>> >"user-role":{"solr":"admin"},
>> >"permissions":[{"name":"security-edit",
>> >   "role":"admin"}]
>> > }}
>> >
>> >
>> > Regards,
>> > Edwin
>> >
>> > On 13 April 2017 at 19:53, Noble Paul  wrote:
>> >
>> > > That looks good. can you share the security.json (commenting out
>> > > anything that's sensitive of course)
>> > >
>> > > On Wed, Apr 12, 2017 at 5:10 PM, Zheng Lin Edwin Yeo
>> > >  wrote:
>> > > > This is what I get when I run the code.
>> > > >
>> > > > org.apache.solr.client.solrj.impl.HttpSolrClient$
>> RemoteSolrException:
>> > > Error
>> > > > from server at http://localhost:8983/solr/testing: Expected mime
>> type
>> > > > application/octet-stream but got text/html. 
>> > > > 
>> > > > 
>> > > > Error 401 require authentication
>> > > > 
>> > > > HTTP ERROR 401
>> > > > Problem accessing /solr/testing/update. Reason:
>> > > > require authentication
>> > > > 
>> > > > 
>> > > >
>> > > > at
>> > > > org.apache.solr.client.solrj.impl.HttpSolrClient.
>> > > executeMethod(HttpSolrClient.java:578)
>> > > > at
>> > > > org.apache.solr.client.solrj.impl.HttpSolrClient.request(
>> > > HttpSolrClient.java:279)
>> > > > at
>> > > > org.apache.solr.client.solrj.impl.HttpSolrClient.request(
>> > > HttpSolrClient.java:268)
>> > > > at org.apache.solr.client.solrj.SolrRequest.process(
>> > > SolrRequest.java:149)
>> > > > at org.apache.solr.client.solrj.SolrClient.add(SolrClient.java:106)
>> > > > at org.apache.solr.client.solrj.SolrClient.add(SolrClient.java:71)
>> > > > at org.apache.solr.client.solrj.SolrClient.add(SolrClient.java:85)
>> > > > at testing.indexing(testing.java:2939)
>> > > > at testing.main(testing.java:329)
>> > > > Exception in thread "main"
>> > > > org.apache.solr.client.solrj.impl.HttpSolrClient$
>> RemoteSolrException:
>> > > Error
>> > > > from server at http://localhost:8983/solr/testing: Expected mime
>> type
>> > > > application/octet-stream but got text/html. 
>> > > > 
>> > > > 
>> > > > Error 401 require authentication
>> > > > 
>> > > > HTTP ERROR 401
>> > > > Problem accessing /solr/testing/update. Reason:
>> > > > require authentication
>> > > > 
>> > > > 
>> > > >
>> > > > at
>> > > > org.apache.solr.client.solrj.impl.HttpSolrClient.
>> > > executeMethod(HttpSolrClient.java:578)
>> > > > at
>> > > > org.apache.solr.client.solrj.impl.HttpSolrClient.request(
>> > > HttpSolrClient.java:279)
>> > > > at
>> > > > org.apache.solr.client.solrj.impl.HttpSolrClient.request(
>> > > HttpSolrClient.java:268)
>> > > > at org.apache.solr.client.solrj.SolrRequest.process(
>> > > SolrRequest.java:149)
>> > > > at org.apache.solr.client.solrj.SolrClient.commit(SolrClient.
>> java:484)
>> > > > at org.apache.solr.client.solrj.SolrClient.commit(SolrClient.
>> java:463)
>> > > > at testing.indexing(testing.java:3063)
>> > > > at testing.main(testing.java:329)
>> > > >
>> > > > Regards,
>> > > > Edwin
>> > > >
>> > > >
>> > > > On 12 April 2017 at 14:28, Noble Paul  wrote:
>> > > >
>> > > >> can u paste the stacktrace here
>> > > >>
>> > > >> On Tue, Apr 11, 2017 at 1:19 PM, Zheng Lin Edwin Yeo
>> > > >>  wrote:
>> > > >> > I found from StackOverflow  that we should declare it this way:
>> > > >> > http://stackoverflow.com/questions/43335419/using-
>> > > >> basicauth-with-solrj-code
>> > > >> >
>> > > >> >
>> > > >> > SolrRequest req = new QueryRequest(new SolrQuery("*:*"));//create
>> a
>> > > new
>> > > >> > request object
>> > > >> > req.setBasicAuthCredentials(userName, password);
>> > > >> > solrClient.request(req);
>> > > >> >
>> > > >> > Is that correct?
>> > > >> >
>> > > >> > For this, the NullPointerException is not coming out, but the
>> SolrJ
>> > is
>> > > 

Re: Filter Facet Query

2017-04-17 Thread Dave
Min.count is what you're looking for to get non 0 facets

> On Apr 17, 2017, at 6:51 PM, Furkan KAMACI  wrote:
> 
> My query:
> 
> /select?facet.field=research=on=content:test
> 
> Q1) Facet returns research values with 0 counts which has a research value
> that is not from a document matched by main query (content:test). Is that
> usual?
> 
> Q2) I want to filter out research values with empty string ("") from facet
> result. How can I do that?
> 
> Kind Regards,
> Furkan KAMACI


Filter Facet Query

2017-04-17 Thread Furkan KAMACI
My query:

/select?facet.field=research=on=content:test

Q1) Facet returns research values with 0 counts which has a research value
that is not from a document matched by main query (content:test). Is that
usual?

Q2) I want to filter out research values with empty string ("") from facet
result. How can I do that?

Kind Regards,
Furkan KAMACI


field with stored="false" is still stored

2017-04-17 Thread Maria Muslea
Hi,


I just upgraded to SOLR 6.4.1 from SOLR 4.10, and am having trouble with
fields set as stored="false".


I edited solrconfig.xml according to the documentation, so I could edit the
schema using schema api.



   true
   managed-schema
 

I added a field using "Add Field" from the Schema GUI, and the field does
appear in managed-schema as:





Once I add a document to SOLR I am able to retrieve this field even though
it is set to stored="false", which means that it is stored.


I found a comment suggesting to remove
AddSchemaFieldsUpdateProcessorFactory so the field isn't readded, but with
no success.


I would appreciate any help.

Thank you,
Maria


Re: Need help with Query Syntax

2017-04-17 Thread OTH
I tried that, but it returned no results.
I understand now that the issue is that since the field has been tokenized
- searching for "*san\ *" will try to search for individual tokens which
contain the string sequence "san ", and so of course it won't find any.
I think I've found another workaround though which might work for me.
Thanks

On Tue, Apr 18, 2017 at 12:56 AM, Mikhail Khludnev  wrote:

> This can be done with escaping space
> select?q=field:*san\ *
> Probably sow=false in new version might also helo
>
>
> On Mon, Apr 17, 2017 at 4:42 PM, OTH  wrote:
>
> > If I submit the query:
> >  "select?q=field:*san*"
> > Then it works as expected; returning all values in the field which
> contain
> > the string "san".
> >
> > However if I submit:
> > "select?q=field:*san *"
> > It then seems to return all the values of the field, regardless of what
> the
> > value is (!)
> >
> > I only wish in this case to get the values which contain the string "san
> ",
> > but I'm unable to achieve that.
> >
> > Thanks
> >
>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>


Re: Need help with Query Syntax

2017-04-17 Thread Mikhail Khludnev
This can be done with escaping space
select?q=field:*san\ *
Probably sow=false in new version might also helo


On Mon, Apr 17, 2017 at 4:42 PM, OTH  wrote:

> If I submit the query:
>  "select?q=field:*san*"
> Then it works as expected; returning all values in the field which contain
> the string "san".
>
> However if I submit:
> "select?q=field:*san *"
> It then seems to return all the values of the field, regardless of what the
> value is (!)
>
> I only wish in this case to get the values which contain the string "san ",
> but I'm unable to achieve that.
>
> Thanks
>



-- 
Sincerely yours
Mikhail Khludnev


Re: Moving solr home

2017-04-17 Thread Susheel Kumar
Hi,

Did you try to utilise the service installation scripts to deploy.  This
makes it very easy for Prod deployments and allows to decouple data/index
directory with Solr binaries. See below link

https://cwiki.apache.org/confluence/display/solr/Taking+Solr+to+Production

Thanks,
Susheel

On Mon, Apr 17, 2017 at 3:46 PM, tedsolr  wrote:

> I have a solr cloud cluster (v5.2.1 on redhat linux) that uses the default
> location for solr home: (install dir)/server/solr. I would like to move the
> index data somewhere else to make upgrades easier. When I set a SOLR_HOME
> variable  solr appears to be ignoring it - and even creating a solr.xml
> file
> in (install dir)/server/solr. Is solr doing some auto detect instead of
> using the defined SOLR_HOME variable?
>
> pre-reqs:
> - copied all index data to new solr home
> - placed a solr.xml file in new solr home
> - set SOLR_HOME & SOLR_PID_DIR in (install dir)/bin/solr.in.sh
> - deleted solr.xml from default solr home
>
> then restart solr nodes:
> - the admin console still shows solr.solr.home as default
> - solr.xml gets recreated in the default solr home folder
>
> Anyone know what I'm missing?
>
>
>
> --
> View this message in context: http://lucene.472066.n3.
> nabble.com/Moving-solr-home-tp4330350.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>


Re: Getting error while excuting full import

2017-04-17 Thread Mikhail Khludnev
Hello, Ankur,

You probably can set clean=false=false and do clean in the
controlling code. See
https://cwiki.apache.org/confluence/display/solr/Uploading+Structured+Data+Store+Data+with+the+Data+Import+Handler
One of thrilling DIH features is merging sorted children and parents with
join="zipper"

On Mon, Apr 17, 2017 at 3:45 PM, ankur.168  wrote:

> Thanks for replying Shawn,
>
> There was an issue with the db connection url, silly mistake.
>
> I am facing one another problem, do not know if should post in the same
> thread or as a new post. Anyways posting here only, let me know if needs to
> be posted as new one.
>
> I am using DIH as you know. I have property_id as a unique key and I have i
> parent and 14-15 child entities(trying to improve performance for pretty
> old
> system hence can't avoid/reduce so many childs).
> We have around 2.5 lacs ids in DB. So full import is becoming kind of near
> impossible for me here. I tried to split this into multiple document files
> within the same core and added a new data import handler as well. but when
> I
> am running import on both urls. The latest data import overrides the
> previous one, hence I am not able to get complete data.
>
> So I have 2 questions here.
>
> 1. Is there a better way of doing indexing and import than the way I am
> doing it right now?
> 2. if no, then how can I make full import faster here?
>
> --Ankur
>
>
>
> --
> View this message in context: http://lucene.472066.n3.
> nabble.com/Getting-error-while-excuting-full-import-tp4329153p4330305.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Sincerely yours
Mikhail Khludnev


Moving solr home

2017-04-17 Thread tedsolr
I have a solr cloud cluster (v5.2.1 on redhat linux) that uses the default
location for solr home: (install dir)/server/solr. I would like to move the
index data somewhere else to make upgrades easier. When I set a SOLR_HOME
variable  solr appears to be ignoring it - and even creating a solr.xml file
in (install dir)/server/solr. Is solr doing some auto detect instead of
using the defined SOLR_HOME variable?

pre-reqs:
- copied all index data to new solr home
- placed a solr.xml file in new solr home
- set SOLR_HOME & SOLR_PID_DIR in (install dir)/bin/solr.in.sh
- deleted solr.xml from default solr home

then restart solr nodes:
- the admin console still shows solr.solr.home as default
- solr.xml gets recreated in the default solr home folder

Anyone know what I'm missing?



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Moving-solr-home-tp4330350.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr Child="true" flag in version 6.4

2017-04-17 Thread Mikhail Khludnev
Hello,
How do you index exactly?
How do you query exactly?
What do you get and how it differs from your expectation?

On Mon, Apr 17, 2017 at 5:12 PM, donjose 
wrote:

> Hello,
>
> I am facing an issue when i am trying to use child="true" in entity.
> For example i am having some relational data in my DB. Please find the
> sample JSOn format below
> {
> Category : "Shirt",
> CategoryId : 1
> Categoryvalues : [
> {
> id : 1,
> size : XL,
>color : red
> },
> {
> id : 2,
> size : XL,
>color : blue
> }
>
> ]
> }
>
> When i am trying to apply child="true", i am getting flat structure. Not
> the
> same way i defined above. Could you please tell me options to create the
> JSON in above mentioned format
>
>
>
> --
> View this message in context: http://lucene.472066.n3.
> nabble.com/Solr-Child-true-flag-in-version-6-4-tp4330312.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Sincerely yours
Mikhail Khludnev


Re: Need help with Query Syntax

2017-04-17 Thread OTH
Ok.  What analyzer / fieldtype should I use to be able to search across
tokens?
Basically, I'm just trying to replicate the functionality of the
AnalyzingInfixLookupFactor Suggester, but I need to do it using a regular
index, because I need to utilize multiple fields using edismax bq, which
seems to not be possible with the Suggester
Thanks

On Mon, Apr 17, 2017 at 10:46 PM, Binoy Dalal 
wrote:

> Use the analyser available in the solr admin console to find out exactly
> how your query is analysed. That should give you a lot more information.
>
> On Mon 17 Apr, 2017, 21:58 OTH,  wrote:
>
> > Ok, I get it now, it's because the field has been indexed as tokens.  So
> > maybe I should use a field which does not have a tokenizer index?  I'll
> try
> > something like that.  Thanks
> >
> > On Mon, Apr 17, 2017 at 9:16 PM, OTH  wrote:
> >
> > > The field type is "text_general".
> > >
> > > On Mon, Apr 17, 2017 at 7:15 PM, Binoy Dalal 
> > > wrote:
> > >
> > >> I think it returns everything because your query matches *san or " *".
> > >> What is your field type definition?
> > >>
> > >> On Mon 17 Apr, 2017, 19:12 OTH,  wrote:
> > >>
> > >> > If I submit the query:
> > >> >  "select?q=field:*san*"
> > >> > Then it works as expected; returning all values in the field which
> > >> contain
> > >> > the string "san".
> > >> >
> > >> > However if I submit:
> > >> > "select?q=field:*san *"
> > >> > It then seems to return all the values of the field, regardless of
> > what
> > >> the
> > >> > value is (!)
> > >> >
> > >> > I only wish in this case to get the values which contain the string
> > >> "san ",
> > >> > but I'm unable to achieve that.
> > >> >
> > >> > Thanks
> > >> >
> > >> --
> > >> Regards,
> > >> Binoy Dalal
> > >>
> > >
> > >
> >
> --
> Regards,
> Binoy Dalal
>


Re: Need help with Query Syntax

2017-04-17 Thread Binoy Dalal
Use the analyser available in the solr admin console to find out exactly
how your query is analysed. That should give you a lot more information.

On Mon 17 Apr, 2017, 21:58 OTH,  wrote:

> Ok, I get it now, it's because the field has been indexed as tokens.  So
> maybe I should use a field which does not have a tokenizer index?  I'll try
> something like that.  Thanks
>
> On Mon, Apr 17, 2017 at 9:16 PM, OTH  wrote:
>
> > The field type is "text_general".
> >
> > On Mon, Apr 17, 2017 at 7:15 PM, Binoy Dalal 
> > wrote:
> >
> >> I think it returns everything because your query matches *san or " *".
> >> What is your field type definition?
> >>
> >> On Mon 17 Apr, 2017, 19:12 OTH,  wrote:
> >>
> >> > If I submit the query:
> >> >  "select?q=field:*san*"
> >> > Then it works as expected; returning all values in the field which
> >> contain
> >> > the string "san".
> >> >
> >> > However if I submit:
> >> > "select?q=field:*san *"
> >> > It then seems to return all the values of the field, regardless of
> what
> >> the
> >> > value is (!)
> >> >
> >> > I only wish in this case to get the values which contain the string
> >> "san ",
> >> > but I'm unable to achieve that.
> >> >
> >> > Thanks
> >> >
> >> --
> >> Regards,
> >> Binoy Dalal
> >>
> >
> >
>
-- 
Regards,
Binoy Dalal


Re: Need help with Query Syntax

2017-04-17 Thread OTH
Ok, I get it now, it's because the field has been indexed as tokens.  So
maybe I should use a field which does not have a tokenizer index?  I'll try
something like that.  Thanks

On Mon, Apr 17, 2017 at 9:16 PM, OTH  wrote:

> The field type is "text_general".
>
> On Mon, Apr 17, 2017 at 7:15 PM, Binoy Dalal 
> wrote:
>
>> I think it returns everything because your query matches *san or " *".
>> What is your field type definition?
>>
>> On Mon 17 Apr, 2017, 19:12 OTH,  wrote:
>>
>> > If I submit the query:
>> >  "select?q=field:*san*"
>> > Then it works as expected; returning all values in the field which
>> contain
>> > the string "san".
>> >
>> > However if I submit:
>> > "select?q=field:*san *"
>> > It then seems to return all the values of the field, regardless of what
>> the
>> > value is (!)
>> >
>> > I only wish in this case to get the values which contain the string
>> "san ",
>> > but I'm unable to achieve that.
>> >
>> > Thanks
>> >
>> --
>> Regards,
>> Binoy Dalal
>>
>
>


Re: Need help with Query Syntax

2017-04-17 Thread OTH
The field type is "text_general".

On Mon, Apr 17, 2017 at 7:15 PM, Binoy Dalal  wrote:

> I think it returns everything because your query matches *san or " *".
> What is your field type definition?
>
> On Mon 17 Apr, 2017, 19:12 OTH,  wrote:
>
> > If I submit the query:
> >  "select?q=field:*san*"
> > Then it works as expected; returning all values in the field which
> contain
> > the string "san".
> >
> > However if I submit:
> > "select?q=field:*san *"
> > It then seems to return all the values of the field, regardless of what
> the
> > value is (!)
> >
> > I only wish in this case to get the values which contain the string "san
> ",
> > but I'm unable to achieve that.
> >
> > Thanks
> >
> --
> Regards,
> Binoy Dalal
>


Re: Getting error while excuting full import

2017-04-17 Thread Erick Erickson
I usually prefer SolrJ, here's an article explaining why and
providing sample code.

https://lucidworks.com/2012/02/14/indexing-with-solrj/

You can take the Tika bit out, they're unnecessary for
importing from a DB.

Best,
Erick

On Mon, Apr 17, 2017 at 5:45 AM, ankur.168  wrote:
> Thanks for replying Shawn,
>
> There was an issue with the db connection url, silly mistake.
>
> I am facing one another problem, do not know if should post in the same
> thread or as a new post. Anyways posting here only, let me know if needs to
> be posted as new one.
>
> I am using DIH as you know. I have property_id as a unique key and I have i
> parent and 14-15 child entities(trying to improve performance for pretty old
> system hence can't avoid/reduce so many childs).
> We have around 2.5 lacs ids in DB. So full import is becoming kind of near
> impossible for me here. I tried to split this into multiple document files
> within the same core and added a new data import handler as well. but when I
> am running import on both urls. The latest data import overrides the
> previous one, hence I am not able to get complete data.
>
> So I have 2 questions here.
>
> 1. Is there a better way of doing indexing and import than the way I am
> doing it right now?
> 2. if no, then how can I make full import faster here?
>
> --Ankur
>
>
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Getting-error-while-excuting-full-import-tp4329153p4330305.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: Filter if Field Exists

2017-04-17 Thread Erik Hatcher
If you need to do an inner purely negative clause, it must be OR’d with *:* - 
queries about matching not excluding.  There’s a shortcut in Solr to allow a 
top-level purely negative clause as convenience but when it gets nested it 
needs pairing explicitly.

Those queries below don’t quite do what you’re asking for though.

Erik



> On Apr 17, 2017, at 7:18 AM, Furkan KAMACI  wrote:
> 
> Btw, what is the difference between
> 
> +name:test +(type:research (*:* -type:[* TO *]))
> 
> and
> 
> +name:test +(type:research -type:[* TO *])
> 
> On Mon, Apr 17, 2017 at 1:33 PM, Furkan KAMACI 
> wrote:
> 
>> Actually, amount of documents which have 'type' field is relatively too
>> small across all documents at index.
>> 
>> On Mon, Apr 17, 2017 at 7:08 AM, Alexandre Rafalovitch >> wrote:
>> 
>>> What about setting a default value for the field? That is probably
>>> faster than negative search clauses?
>>> 
>>> Regards,
>>>   Alex.
>>> 
>>> http://www.solr-start.com/ - Resources for Solr users, new and
>>> experienced
>>> 
>>> 
>>> On 16 April 2017 at 23:58, Mikhail Khludnev  wrote:
 +name:test +(type:research (*:* -type:[* TO *]))
 
 On Sun, Apr 16, 2017 at 11:47 PM, Furkan KAMACI  Hi,
> 
> I have a schema like:
> 
> name,
> department,
> type
> 
> type is an optional field. Some documents don't have that field. Let's
> assume I have these:
> 
> Doc 1:
> name: test
> type: research
> 
> Doc 2:
> name: test
> type: developer
> 
> Doc 3:
> name: test
> 
> I want to search name: test and type:research if type field exists
>>> (result
> will be Doc 1 and Doc 3).
> 
> How can I do that?
> 
> Kind Regards,
> Furkan KAMACI
> 
 
 
 
 --
 Sincerely yours
 Mikhail Khludnev
>>> 
>> 
>> 



Re: Filter if Field Exists

2017-04-17 Thread Erik Hatcher
Too many ‘+’’s in there, I think.  

I think the query you want is this, and let’s be precise about the query parser 
here too in case that’s getting in the way and split this stuff up into 
separate reusable clauses:

?qq=test
_no_type=({!field f=name v=$qq} -type:*)
_research=({!field f=name v=$qq} type:research)
={!lucene}${q_no_type) OR ${q_research}

Sorry, that’s just how my brain thinks, above - in splitting this stuff out.   
But in one line it’s really:

   q=(name:test -type:*) OR (name:test AND type:research)

Erik



> On Apr 17, 2017, at 7:22 AM, Furkan KAMACI  wrote:
> 
> On the other hand, that query does not do what I want.
> 
> On Mon, Apr 17, 2017 at 2:18 PM, Furkan KAMACI 
> wrote:
> 
>> Btw, what is the difference between
>> 
>> +name:test +(type:research (*:* -type:[* TO *]))
>> 
>> and
>> 
>> +name:test +(type:research -type:[* TO *])
>> 
>> On Mon, Apr 17, 2017 at 1:33 PM, Furkan KAMACI 
>> wrote:
>> 
>>> Actually, amount of documents which have 'type' field is relatively too
>>> small across all documents at index.
>>> 
>>> On Mon, Apr 17, 2017 at 7:08 AM, Alexandre Rafalovitch <
>>> arafa...@gmail.com> wrote:
>>> 
 What about setting a default value for the field? That is probably
 faster than negative search clauses?
 
 Regards,
   Alex.
 
 http://www.solr-start.com/ - Resources for Solr users, new and
 experienced
 
 
 On 16 April 2017 at 23:58, Mikhail Khludnev  wrote:
> +name:test +(type:research (*:* -type:[* TO *]))
> 
> On Sun, Apr 16, 2017 at 11:47 PM, Furkan KAMACI <
 furkankam...@gmail.com>
> wrote:
> 
>> Hi,
>> 
>> I have a schema like:
>> 
>> name,
>> department,
>> type
>> 
>> type is an optional field. Some documents don't have that field. Let's
>> assume I have these:
>> 
>> Doc 1:
>> name: test
>> type: research
>> 
>> Doc 2:
>> name: test
>> type: developer
>> 
>> Doc 3:
>> name: test
>> 
>> I want to search name: test and type:research if type field exists
 (result
>> will be Doc 1 and Doc 3).
>> 
>> How can I do that?
>> 
>> Kind Regards,
>> Furkan KAMACI
>> 
> 
> 
> 
> --
> Sincerely yours
> Mikhail Khludnev
 
>>> 
>>> 
>> 



Solr Child="true" flag in version 6.4

2017-04-17 Thread donjose
Hello,

I am facing an issue when i am trying to use child="true" in entity.
For example i am having some relational data in my DB. Please find the
sample JSOn format below
{
Category : "Shirt",
CategoryId : 1
Categoryvalues : [
{
id : 1,
size : XL,
   color : red
},
{
id : 2,
size : XL,
   color : blue
}

]
}

When i am trying to apply child="true", i am getting flat structure. Not the
same way i defined above. Could you please tell me options to create the
JSON in above mentioned format



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Child-true-flag-in-version-6-4-tp4330312.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Filter if Field Exists

2017-04-17 Thread Furkan KAMACI
@Alexandre Rafalovitch,

I could define empty string => "" as default value but than I do facet on
that field too. I will need to filter empty strings from facet generation
logic. By the way, which one is faster:

either defining empty string as default value and appending (OR type:"") to
queries
or negative search clauses?

On Mon, Apr 17, 2017 at 2:22 PM, Furkan KAMACI 
wrote:

> On the other hand, that query does not do what I want.
>
> On Mon, Apr 17, 2017 at 2:18 PM, Furkan KAMACI 
> wrote:
>
>> Btw, what is the difference between
>>
>> +name:test +(type:research (*:* -type:[* TO *]))
>>
>> and
>>
>> +name:test +(type:research -type:[* TO *])
>>
>> On Mon, Apr 17, 2017 at 1:33 PM, Furkan KAMACI 
>> wrote:
>>
>>> Actually, amount of documents which have 'type' field is relatively too
>>> small across all documents at index.
>>>
>>> On Mon, Apr 17, 2017 at 7:08 AM, Alexandre Rafalovitch <
>>> arafa...@gmail.com> wrote:
>>>
 What about setting a default value for the field? That is probably
 faster than negative search clauses?

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


 On 16 April 2017 at 23:58, Mikhail Khludnev  wrote:
 > +name:test +(type:research (*:* -type:[* TO *]))
 >
 > On Sun, Apr 16, 2017 at 11:47 PM, Furkan KAMACI <
 furkankam...@gmail.com>
 > wrote:
 >
 >> Hi,
 >>
 >> I have a schema like:
 >>
 >> name,
 >> department,
 >> type
 >>
 >> type is an optional field. Some documents don't have that field.
 Let's
 >> assume I have these:
 >>
 >> Doc 1:
 >> name: test
 >> type: research
 >>
 >> Doc 2:
 >> name: test
 >> type: developer
 >>
 >> Doc 3:
 >> name: test
 >>
 >> I want to search name: test and type:research if type field exists
 (result
 >> will be Doc 1 and Doc 3).
 >>
 >> How can I do that?
 >>
 >> Kind Regards,
 >> Furkan KAMACI
 >>
 >
 >
 >
 > --
 > Sincerely yours
 > Mikhail Khludnev

>>>
>>>
>>
>


Re: Need help with Query Syntax

2017-04-17 Thread Binoy Dalal
I think it returns everything because your query matches *san or " *".
What is your field type definition?

On Mon 17 Apr, 2017, 19:12 OTH,  wrote:

> If I submit the query:
>  "select?q=field:*san*"
> Then it works as expected; returning all values in the field which contain
> the string "san".
>
> However if I submit:
> "select?q=field:*san *"
> It then seems to return all the values of the field, regardless of what the
> value is (!)
>
> I only wish in this case to get the values which contain the string "san ",
> but I'm unable to achieve that.
>
> Thanks
>
-- 
Regards,
Binoy Dalal


Need help with Query Syntax

2017-04-17 Thread OTH
If I submit the query:
 "select?q=field:*san*"
Then it works as expected; returning all values in the field which contain
the string "san".

However if I submit:
"select?q=field:*san *"
It then seems to return all the values of the field, regardless of what the
value is (!)

I only wish in this case to get the values which contain the string "san ",
but I'm unable to achieve that.

Thanks


Re: Getting error while excuting full import

2017-04-17 Thread ankur.168
Thanks for replying Shawn,

There was an issue with the db connection url, silly mistake.

I am facing one another problem, do not know if should post in the same
thread or as a new post. Anyways posting here only, let me know if needs to
be posted as new one.

I am using DIH as you know. I have property_id as a unique key and I have i
parent and 14-15 child entities(trying to improve performance for pretty old
system hence can't avoid/reduce so many childs).
We have around 2.5 lacs ids in DB. So full import is becoming kind of near
impossible for me here. I tried to split this into multiple document files
within the same core and added a new data import handler as well. but when I
am running import on both urls. The latest data import overrides the
previous one, hence I am not able to get complete data.

So I have 2 questions here.

1. Is there a better way of doing indexing and import than the way I am
doing it right now?
2. if no, then how can I make full import faster here?

--Ankur



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Getting-error-while-excuting-full-import-tp4329153p4330305.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Filter if Field Exists

2017-04-17 Thread Furkan KAMACI
On the other hand, that query does not do what I want.

On Mon, Apr 17, 2017 at 2:18 PM, Furkan KAMACI 
wrote:

> Btw, what is the difference between
>
> +name:test +(type:research (*:* -type:[* TO *]))
>
> and
>
> +name:test +(type:research -type:[* TO *])
>
> On Mon, Apr 17, 2017 at 1:33 PM, Furkan KAMACI 
> wrote:
>
>> Actually, amount of documents which have 'type' field is relatively too
>> small across all documents at index.
>>
>> On Mon, Apr 17, 2017 at 7:08 AM, Alexandre Rafalovitch <
>> arafa...@gmail.com> wrote:
>>
>>> What about setting a default value for the field? That is probably
>>> faster than negative search clauses?
>>>
>>> Regards,
>>>Alex.
>>> 
>>> http://www.solr-start.com/ - Resources for Solr users, new and
>>> experienced
>>>
>>>
>>> On 16 April 2017 at 23:58, Mikhail Khludnev  wrote:
>>> > +name:test +(type:research (*:* -type:[* TO *]))
>>> >
>>> > On Sun, Apr 16, 2017 at 11:47 PM, Furkan KAMACI <
>>> furkankam...@gmail.com>
>>> > wrote:
>>> >
>>> >> Hi,
>>> >>
>>> >> I have a schema like:
>>> >>
>>> >> name,
>>> >> department,
>>> >> type
>>> >>
>>> >> type is an optional field. Some documents don't have that field. Let's
>>> >> assume I have these:
>>> >>
>>> >> Doc 1:
>>> >> name: test
>>> >> type: research
>>> >>
>>> >> Doc 2:
>>> >> name: test
>>> >> type: developer
>>> >>
>>> >> Doc 3:
>>> >> name: test
>>> >>
>>> >> I want to search name: test and type:research if type field exists
>>> (result
>>> >> will be Doc 1 and Doc 3).
>>> >>
>>> >> How can I do that?
>>> >>
>>> >> Kind Regards,
>>> >> Furkan KAMACI
>>> >>
>>> >
>>> >
>>> >
>>> > --
>>> > Sincerely yours
>>> > Mikhail Khludnev
>>>
>>
>>
>


Re: Filter if Field Exists

2017-04-17 Thread Furkan KAMACI
Btw, what is the difference between

+name:test +(type:research (*:* -type:[* TO *]))

and

+name:test +(type:research -type:[* TO *])

On Mon, Apr 17, 2017 at 1:33 PM, Furkan KAMACI 
wrote:

> Actually, amount of documents which have 'type' field is relatively too
> small across all documents at index.
>
> On Mon, Apr 17, 2017 at 7:08 AM, Alexandre Rafalovitch  > wrote:
>
>> What about setting a default value for the field? That is probably
>> faster than negative search clauses?
>>
>> Regards,
>>Alex.
>> 
>> http://www.solr-start.com/ - Resources for Solr users, new and
>> experienced
>>
>>
>> On 16 April 2017 at 23:58, Mikhail Khludnev  wrote:
>> > +name:test +(type:research (*:* -type:[* TO *]))
>> >
>> > On Sun, Apr 16, 2017 at 11:47 PM, Furkan KAMACI > >
>> > wrote:
>> >
>> >> Hi,
>> >>
>> >> I have a schema like:
>> >>
>> >> name,
>> >> department,
>> >> type
>> >>
>> >> type is an optional field. Some documents don't have that field. Let's
>> >> assume I have these:
>> >>
>> >> Doc 1:
>> >> name: test
>> >> type: research
>> >>
>> >> Doc 2:
>> >> name: test
>> >> type: developer
>> >>
>> >> Doc 3:
>> >> name: test
>> >>
>> >> I want to search name: test and type:research if type field exists
>> (result
>> >> will be Doc 1 and Doc 3).
>> >>
>> >> How can I do that?
>> >>
>> >> Kind Regards,
>> >> Furkan KAMACI
>> >>
>> >
>> >
>> >
>> > --
>> > Sincerely yours
>> > Mikhail Khludnev
>>
>
>


Re: Filter if Field Exists

2017-04-17 Thread Furkan KAMACI
Actually, amount of documents which have 'type' field is relatively too
small across all documents at index.

On Mon, Apr 17, 2017 at 7:08 AM, Alexandre Rafalovitch 
wrote:

> What about setting a default value for the field? That is probably
> faster than negative search clauses?
>
> Regards,
>Alex.
> 
> http://www.solr-start.com/ - Resources for Solr users, new and experienced
>
>
> On 16 April 2017 at 23:58, Mikhail Khludnev  wrote:
> > +name:test +(type:research (*:* -type:[* TO *]))
> >
> > On Sun, Apr 16, 2017 at 11:47 PM, Furkan KAMACI 
> > wrote:
> >
> >> Hi,
> >>
> >> I have a schema like:
> >>
> >> name,
> >> department,
> >> type
> >>
> >> type is an optional field. Some documents don't have that field. Let's
> >> assume I have these:
> >>
> >> Doc 1:
> >> name: test
> >> type: research
> >>
> >> Doc 2:
> >> name: test
> >> type: developer
> >>
> >> Doc 3:
> >> name: test
> >>
> >> I want to search name: test and type:research if type field exists
> (result
> >> will be Doc 1 and Doc 3).
> >>
> >> How can I do that?
> >>
> >> Kind Regards,
> >> Furkan KAMACI
> >>
> >
> >
> >
> > --
> > Sincerely yours
> > Mikhail Khludnev
>


Re: How to get field names of dynamic field

2017-04-17 Thread Alexandre Rafalovitch
Ugh.

Ok, so if the list is different per-request, you should probably look
at writing a custom search component if you want to keep it all in
Solr layer.

But really, you have middle-ware, right? Why don't you formulate your
query with all the business requirement specifics in there.

Regards,
   Alex.

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


On 17 April 2017 at 11:19, Midas A  wrote:
> Here if i am saying dynamic say *by_* *is the  field then by_color, by_size
> .. etc . would be the dynamic fields .
>
> Regards,
> Abhishek Tiwari
>
> On Mon, Apr 17, 2017 at 1:47 PM, Midas A  wrote:
>
>> Thanks alex,
>>
>> I want all dynamic fields related to a query( i.e. category_id : 199
>>  where 199 category has around 1 docs) .
>>
>> How we can get this with help of luke Request handler.
>>
>> On Mon, Apr 17, 2017 at 1:39 PM, Alexandre Rafalovitch > > wrote:
>>
>>> You could externalize that by periodically:
>>> 1) Running a luke query or Schema API to get the list of fields
>>> 2) Running Request Parameter API to update the list of field to return
>>> (this does not cause core reload)
>>> 3) If you have permanent field list on top of dynamic ones, you could
>>> use parameter substitution as well to combine them
>>> 4) if you really, really need to be in sync, you could use commit hook
>>> to trigger this
>>>
>>> Regards,
>>>Alex.
>>> 
>>> http://www.solr-start.com/ - Resources for Solr users, new and
>>> experienced
>>>
>>>
>>> On 17 April 2017 at 11:00, Midas A  wrote:
>>> > Can we do faceting for all fields created by dynamically created fields
>>> > rather sending explicitly sending it by query
>>> > will facet.fields=*by_* *
>>> > work or any other alternate ??
>>> >
>>> > I was thinking that i will get all dynamic fields with help of Luke
>>> handler
>>> > . But probably it is not possible through luke for a query
>>> >
>>> >
>>> >
>>> > On Fri, Apr 14, 2017 at 5:32 PM, Ahmet Arslan >> >
>>> > wrote:
>>> >
>>> >> Hi Midas,
>>> >>
>>> >> LukeRequestHandler shows that information.
>>> >>
>>> >> Ahmet
>>> >>
>>> >> On Friday, April 14, 2017, 1:16:09 PM GMT+3, Midas A <
>>> test.mi...@gmail.com>
>>> >> wrote:
>>> >> Actually , i am looking for APi
>>> >>
>>> >> On Fri, Apr 14, 2017 at 3:36 PM, Andrea Gazzarini 
>>> >> wrote:
>>> >>
>>> >> > I can see those names in the "Schema  browser" of the admin UI, so I
>>> >> guess
>>> >> > using the (lucene?) API it shouldn't be hard to get this info.
>>> >> >
>>> >> > I don' know if the schema api (or some other service) offer this
>>> service
>>> >> >
>>> >> > Andrea
>>> >> >
>>> >> > On 14 Apr 2017 10:03, "Midas A"  wrote:
>>> >> >
>>> >> > > Hi,
>>> >> > >
>>> >> > >
>>> >> > > Can i get all the field created for dynamic field in solr .
>>> >> > >
>>> >> > > Like
>>> >> > > my dynamic field is by_*
>>> >> > >
>>> >> > > and i have index
>>> >> > > by_color
>>> >> > > by_size ..
>>> >> > > etc
>>> >> > >
>>> >> > > I want to retrieve all these field name .
>>> >> > > Is there any way to do this  based on some query
>>> >> > >
>>> >> >
>>> >>
>>>
>>
>>


Re: How to get field names of dynamic field

2017-04-17 Thread Midas A
Here if i am saying dynamic say *by_* *is the  field then by_color, by_size
.. etc . would be the dynamic fields .

Regards,
Abhishek Tiwari

On Mon, Apr 17, 2017 at 1:47 PM, Midas A  wrote:

> Thanks alex,
>
> I want all dynamic fields related to a query( i.e. category_id : 199
>  where 199 category has around 1 docs) .
>
> How we can get this with help of luke Request handler.
>
> On Mon, Apr 17, 2017 at 1:39 PM, Alexandre Rafalovitch  > wrote:
>
>> You could externalize that by periodically:
>> 1) Running a luke query or Schema API to get the list of fields
>> 2) Running Request Parameter API to update the list of field to return
>> (this does not cause core reload)
>> 3) If you have permanent field list on top of dynamic ones, you could
>> use parameter substitution as well to combine them
>> 4) if you really, really need to be in sync, you could use commit hook
>> to trigger this
>>
>> Regards,
>>Alex.
>> 
>> http://www.solr-start.com/ - Resources for Solr users, new and
>> experienced
>>
>>
>> On 17 April 2017 at 11:00, Midas A  wrote:
>> > Can we do faceting for all fields created by dynamically created fields
>> > rather sending explicitly sending it by query
>> > will facet.fields=*by_* *
>> > work or any other alternate ??
>> >
>> > I was thinking that i will get all dynamic fields with help of Luke
>> handler
>> > . But probably it is not possible through luke for a query
>> >
>> >
>> >
>> > On Fri, Apr 14, 2017 at 5:32 PM, Ahmet Arslan > >
>> > wrote:
>> >
>> >> Hi Midas,
>> >>
>> >> LukeRequestHandler shows that information.
>> >>
>> >> Ahmet
>> >>
>> >> On Friday, April 14, 2017, 1:16:09 PM GMT+3, Midas A <
>> test.mi...@gmail.com>
>> >> wrote:
>> >> Actually , i am looking for APi
>> >>
>> >> On Fri, Apr 14, 2017 at 3:36 PM, Andrea Gazzarini 
>> >> wrote:
>> >>
>> >> > I can see those names in the "Schema  browser" of the admin UI, so I
>> >> guess
>> >> > using the (lucene?) API it shouldn't be hard to get this info.
>> >> >
>> >> > I don' know if the schema api (or some other service) offer this
>> service
>> >> >
>> >> > Andrea
>> >> >
>> >> > On 14 Apr 2017 10:03, "Midas A"  wrote:
>> >> >
>> >> > > Hi,
>> >> > >
>> >> > >
>> >> > > Can i get all the field created for dynamic field in solr .
>> >> > >
>> >> > > Like
>> >> > > my dynamic field is by_*
>> >> > >
>> >> > > and i have index
>> >> > > by_color
>> >> > > by_size ..
>> >> > > etc
>> >> > >
>> >> > > I want to retrieve all these field name .
>> >> > > Is there any way to do this  based on some query
>> >> > >
>> >> >
>> >>
>>
>
>


Re: How to get field names of dynamic field

2017-04-17 Thread Midas A
Thanks alex,

I want all dynamic fields related to a query( i.e. category_id : 199  where
199 category has around 1 docs) .

How we can get this with help of luke Request handler.

On Mon, Apr 17, 2017 at 1:39 PM, Alexandre Rafalovitch 
wrote:

> You could externalize that by periodically:
> 1) Running a luke query or Schema API to get the list of fields
> 2) Running Request Parameter API to update the list of field to return
> (this does not cause core reload)
> 3) If you have permanent field list on top of dynamic ones, you could
> use parameter substitution as well to combine them
> 4) if you really, really need to be in sync, you could use commit hook
> to trigger this
>
> Regards,
>Alex.
> 
> http://www.solr-start.com/ - Resources for Solr users, new and experienced
>
>
> On 17 April 2017 at 11:00, Midas A  wrote:
> > Can we do faceting for all fields created by dynamically created fields
> > rather sending explicitly sending it by query
> > will facet.fields=*by_* *
> > work or any other alternate ??
> >
> > I was thinking that i will get all dynamic fields with help of Luke
> handler
> > . But probably it is not possible through luke for a query
> >
> >
> >
> > On Fri, Apr 14, 2017 at 5:32 PM, Ahmet Arslan  >
> > wrote:
> >
> >> Hi Midas,
> >>
> >> LukeRequestHandler shows that information.
> >>
> >> Ahmet
> >>
> >> On Friday, April 14, 2017, 1:16:09 PM GMT+3, Midas A <
> test.mi...@gmail.com>
> >> wrote:
> >> Actually , i am looking for APi
> >>
> >> On Fri, Apr 14, 2017 at 3:36 PM, Andrea Gazzarini 
> >> wrote:
> >>
> >> > I can see those names in the "Schema  browser" of the admin UI, so I
> >> guess
> >> > using the (lucene?) API it shouldn't be hard to get this info.
> >> >
> >> > I don' know if the schema api (or some other service) offer this
> service
> >> >
> >> > Andrea
> >> >
> >> > On 14 Apr 2017 10:03, "Midas A"  wrote:
> >> >
> >> > > Hi,
> >> > >
> >> > >
> >> > > Can i get all the field created for dynamic field in solr .
> >> > >
> >> > > Like
> >> > > my dynamic field is by_*
> >> > >
> >> > > and i have index
> >> > > by_color
> >> > > by_size ..
> >> > > etc
> >> > >
> >> > > I want to retrieve all these field name .
> >> > > Is there any way to do this  based on some query
> >> > >
> >> >
> >>
>


Re: How to get field names of dynamic field

2017-04-17 Thread Alexandre Rafalovitch
You could externalize that by periodically:
1) Running a luke query or Schema API to get the list of fields
2) Running Request Parameter API to update the list of field to return
(this does not cause core reload)
3) If you have permanent field list on top of dynamic ones, you could
use parameter substitution as well to combine them
4) if you really, really need to be in sync, you could use commit hook
to trigger this

Regards,
   Alex.

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


On 17 April 2017 at 11:00, Midas A  wrote:
> Can we do faceting for all fields created by dynamically created fields
> rather sending explicitly sending it by query
> will facet.fields=*by_* *
> work or any other alternate ??
>
> I was thinking that i will get all dynamic fields with help of Luke handler
> . But probably it is not possible through luke for a query
>
>
>
> On Fri, Apr 14, 2017 at 5:32 PM, Ahmet Arslan 
> wrote:
>
>> Hi Midas,
>>
>> LukeRequestHandler shows that information.
>>
>> Ahmet
>>
>> On Friday, April 14, 2017, 1:16:09 PM GMT+3, Midas A 
>> wrote:
>> Actually , i am looking for APi
>>
>> On Fri, Apr 14, 2017 at 3:36 PM, Andrea Gazzarini 
>> wrote:
>>
>> > I can see those names in the "Schema  browser" of the admin UI, so I
>> guess
>> > using the (lucene?) API it shouldn't be hard to get this info.
>> >
>> > I don' know if the schema api (or some other service) offer this service
>> >
>> > Andrea
>> >
>> > On 14 Apr 2017 10:03, "Midas A"  wrote:
>> >
>> > > Hi,
>> > >
>> > >
>> > > Can i get all the field created for dynamic field in solr .
>> > >
>> > > Like
>> > > my dynamic field is by_*
>> > >
>> > > and i have index
>> > > by_color
>> > > by_size ..
>> > > etc
>> > >
>> > > I want to retrieve all these field name .
>> > > Is there any way to do this  based on some query
>> > >
>> >
>>


Re: How to get field names of dynamic field

2017-04-17 Thread Midas A
Can we do faceting for all fields created by dynamically created fields
rather sending explicitly sending it by query
will facet.fields=*by_* *
work or any other alternate ??

I was thinking that i will get all dynamic fields with help of Luke handler
. But probably it is not possible through luke for a query



On Fri, Apr 14, 2017 at 5:32 PM, Ahmet Arslan 
wrote:

> Hi Midas,
>
> LukeRequestHandler shows that information.
>
> Ahmet
>
> On Friday, April 14, 2017, 1:16:09 PM GMT+3, Midas A 
> wrote:
> Actually , i am looking for APi
>
> On Fri, Apr 14, 2017 at 3:36 PM, Andrea Gazzarini 
> wrote:
>
> > I can see those names in the "Schema  browser" of the admin UI, so I
> guess
> > using the (lucene?) API it shouldn't be hard to get this info.
> >
> > I don' know if the schema api (or some other service) offer this service
> >
> > Andrea
> >
> > On 14 Apr 2017 10:03, "Midas A"  wrote:
> >
> > > Hi,
> > >
> > >
> > > Can i get all the field created for dynamic field in solr .
> > >
> > > Like
> > > my dynamic field is by_*
> > >
> > > and i have index
> > > by_color
> > > by_size ..
> > > etc
> > >
> > > I want to retrieve all these field name .
> > > Is there any way to do this  based on some query
> > >
> >
>