You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by sathish_ix <sk...@inautix.co.in> on 2013/05/31 14:42:54 UTC

Question on distrib=false

Hi,

We have following setup ,


Maseter ------------ Slave 1
      |_____________ Slave 2

we indexed few records in slave1 and few records in slave2, while querying
we need data only from slave 1.
So used below query

http://xxx.com/solr/select?q=*:*&shards=slave1,slave2&distrib=false

We are getting results from both slaves... Will this work in this setup  ?

Thanks,
Sathish



--
View this message in context: http://lucene.472066.n3.nabble.com/Question-on-distrib-false-tp4067305.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Question on distrib=false

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
I think you misunderstand the concept of shards. If slave1 and slave2 are
replicas of the master then neither "shards" param nor "distrib" parameter
is required.


On Fri, May 31, 2013 at 6:12 PM, sathish_ix <sk...@inautix.co.in>wrote:

> Hi,
>
> We have following setup ,
>
>
> Maseter ------------ Slave 1
>       |_____________ Slave 2
>
> we indexed few records in slave1 and few records in slave2, while querying
> we need data only from slave 1.
> So used below query
>
> http://xxx.com/solr/select?q=*:*&shards=slave1,slave2&distrib=false
>
> We are getting results from both slaves... Will this work in this setup  ?
>
> Thanks,
> Sathish
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Question-on-distrib-false-tp4067305.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Regards,
Shalin Shekhar Mangar.

Re: dataConfig DTD or schema

Posted by Chris Hostetter <ho...@fucit.org>.
: References: <13...@n3.nabble.com>
: In-Reply-To: <13...@n3.nabble.com>
: Subject: dataConfig DTD or schema

https://people.apache.org/~hossman/#threadhijack
Thread Hijacking on Mailing Lists

When starting a new discussion on a mailing list, please do not reply to 
an existing message, instead start a fresh email.  Even if you change the 
subject line of your email, other mail headers still track which thread 
you replied to and your question is "hidden" in that thread and gets less 
attention.   It makes following discussions in the mailing list archives 
particularly difficult.



-Hoss

Re: dataConfig DTD or schema

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
You can do a custom transformer in DIH which will do a default value.
If you do, it could be a good one to contribute.

Otherwise, you can have two different DIH handlers defined in
solrconfig.xml with different UpdateRequestProcessor chains and use
http://lucene.apache.org/solr/4_0_0/solr-core/org/apache/solr/update/processor/DefaultValueUpdateProcessorFactory.html
.

There is always more than one interceptor option in Solr. :-)

Regards,
   Alex.
Personal blog: http://blog.outerthoughts.com/
LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
- Time is the quality of nature that keeps events from happening all
at once. Lately, it doesn't seem to be working.  (Anonymous  - via GTD
book)


On Fri, May 31, 2013 at 11:05 AM, Hans-Peter Stricker
<st...@epublius.de> wrote:
> On the other side: I have a problem. Because I want to give some entities a
> default value "A" and others default value "B" - which I could do inside a
> <field>inside of<entity> in data-config.xml but not inside a <field> in
> schema.xml.
>
>
> --------------------------------------------------
> From: "Shalin Shekhar Mangar" <sh...@gmail.com>
> Sent: Friday, May 31, 2013 4:59 PM
> To: <so...@lucene.apache.org>
> Subject: Re: dataConfig DTD or schema
>
>> DataImportHandler does not support specifying default values for a field.
>> However, the solr schema.xml lets you specify defaults. So, modify the
>> corresponding field inside solr's schema.xml. For example:
>>
>> <field name="letit" type="text" indexed="true" stored="true"
>> default="BE"/>
>>
>>
>> On Fri, May 31, 2013 at 8:20 PM, Hans-Peter Stricker
>> <st...@epublius.de>wrote:
>>
>>> I wonder how to pass default values via <dataConfig>, e.g. like this:
>>>
>>> <dataConfig>
>>>    <dataSource />
>>>    <document>
>>>        <entity>            <field column="letit">BE</field>
>>>        </entity>
>>>    </document>
>>> </dataConfig>
>>>
>>> or like this:
>>>
>>> <dataConfig>
>>>    <dataSource />
>>>    <document>
>>>        <entity>            <field column="letit" value="BE"/>
>>>        </entity>
>>>    </document>
>>> </dataConfig>
>>>
>>> In the course of this, I did not find a DTD or Schema for <dataConfig>.
>>>
>>> Any hint is appreciated!!
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Regards,
>> Shalin Shekhar Mangar.
>>
>

Re: dataConfig DTD or schema

Posted by Chris Hostetter <ho...@fucit.org>.
: > TemplateTransformer
: 
: But doesn't that override the value even if it is present? I thought
: the request was for default value if one is not supplied. Though maybe
: I was wrong.

Bah!  You are completley correct ... I didn't fully understand the 
question.  

Sorry for the noise.


-Hoss

Re: dataConfig DTD or schema

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
On Fri, May 31, 2013 at 1:43 PM, Chris Hostetter
<ho...@fucit.org> wrote:
> TemplateTransformer

But doesn't that override the value even if it is present? I thought
the request was for default value if one is not supplied. Though maybe
I was wrong.

Regards,
   Alex.

Personal blog: http://blog.outerthoughts.com/
LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
- Time is the quality of nature that keeps events from happening all
at once. Lately, it doesn't seem to be working.  (Anonymous  - via GTD
book)

Re: dataConfig DTD or schema

Posted by Chris Hostetter <ho...@fucit.org>.
: > On the other side: I have a problem. Because I want to give some entities
: > a default value "A" and others default value "B" - which I could do inside
: > a <field>inside of<entity> in data-config.xml but not inside a <field> in
: > schema.xml.

: In that case, you will need to write a custom DIH Transformer.

Nope ... you cna just use TemplateTransformer and specify a static value 
with no variables for the template...

http://wiki.apache.org/solr/DataImportHandlerFaq#How_would_I_insert_a_static_value_into_a_field_.3F


-Hoss

Re: dataConfig DTD or schema

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Fri, May 31, 2013 at 8:35 PM, Hans-Peter Stricker
<st...@epublius.de>wrote:

> On the other side: I have a problem. Because I want to give some entities
> a default value "A" and others default value "B" - which I could do inside
> a <field>inside of<entity> in data-config.xml but not inside a <field> in
> schema.xml.
>
>
In that case, you will need to write a custom DIH Transformer.

See http://wiki.apache.org/solr/DataImportHandler#ScriptTransformer or
http://wiki.apache.org/solr/DIHCustomTransformer


-- 
Regards,
Shalin Shekhar Mangar.

Re: dataConfig DTD or schema

Posted by Hans-Peter Stricker <st...@epublius.de>.
On the other side: I have a problem. Because I want to give some entities a 
default value "A" and others default value "B" - which I could do inside a 
<field>inside of<entity> in data-config.xml but not inside a <field> in 
schema.xml.

--------------------------------------------------
From: "Shalin Shekhar Mangar" <sh...@gmail.com>
Sent: Friday, May 31, 2013 4:59 PM
To: <so...@lucene.apache.org>
Subject: Re: dataConfig DTD or schema

> DataImportHandler does not support specifying default values for a field.
> However, the solr schema.xml lets you specify defaults. So, modify the
> corresponding field inside solr's schema.xml. For example:
>
> <field name="letit" type="text" indexed="true" stored="true" 
> default="BE"/>
>
>
> On Fri, May 31, 2013 at 8:20 PM, Hans-Peter Stricker
> <st...@epublius.de>wrote:
>
>> I wonder how to pass default values via <dataConfig>, e.g. like this:
>>
>> <dataConfig>
>>    <dataSource />
>>    <document>
>>        <entity>            <field column="letit">BE</field>
>>        </entity>
>>    </document>
>> </dataConfig>
>>
>> or like this:
>>
>> <dataConfig>
>>    <dataSource />
>>    <document>
>>        <entity>            <field column="letit" value="BE"/>
>>        </entity>
>>    </document>
>> </dataConfig>
>>
>> In the course of this, I did not find a DTD or Schema for <dataConfig>.
>>
>> Any hint is appreciated!!
>>
>>
>>
>>
>
>
> -- 
> Regards,
> Shalin Shekhar Mangar.
> 


Re: dataConfig DTD or schema

Posted by Hans-Peter Stricker <st...@epublius.de>.
You are great! Thanks a lot for taking the time.

--------------------------------------------------
From: "Shalin Shekhar Mangar" <sh...@gmail.com>
Sent: Friday, May 31, 2013 4:59 PM
To: <so...@lucene.apache.org>
Subject: Re: dataConfig DTD or schema

> DataImportHandler does not support specifying default values for a field.
> However, the solr schema.xml lets you specify defaults. So, modify the
> corresponding field inside solr's schema.xml. For example:
>
> <field name="letit" type="text" indexed="true" stored="true" 
> default="BE"/>
>
>
> On Fri, May 31, 2013 at 8:20 PM, Hans-Peter Stricker
> <st...@epublius.de>wrote:
>
>> I wonder how to pass default values via <dataConfig>, e.g. like this:
>>
>> <dataConfig>
>>    <dataSource />
>>    <document>
>>        <entity>            <field column="letit">BE</field>
>>        </entity>
>>    </document>
>> </dataConfig>
>>
>> or like this:
>>
>> <dataConfig>
>>    <dataSource />
>>    <document>
>>        <entity>            <field column="letit" value="BE"/>
>>        </entity>
>>    </document>
>> </dataConfig>
>>
>> In the course of this, I did not find a DTD or Schema for <dataConfig>.
>>
>> Any hint is appreciated!!
>>
>>
>>
>>
>
>
> -- 
> Regards,
> Shalin Shekhar Mangar.
> 


Re: dataConfig DTD or schema

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
DataImportHandler does not support specifying default values for a field.
However, the solr schema.xml lets you specify defaults. So, modify the
corresponding field inside solr's schema.xml. For example:

<field name="letit" type="text" indexed="true" stored="true" default="BE"/>


On Fri, May 31, 2013 at 8:20 PM, Hans-Peter Stricker
<st...@epublius.de>wrote:

> I wonder how to pass default values via <dataConfig>, e.g. like this:
>
> <dataConfig>
>    <dataSource />
>    <document>
>        <entity>            <field column="letit">BE</field>
>        </entity>
>    </document>
> </dataConfig>
>
> or like this:
>
> <dataConfig>
>    <dataSource />
>    <document>
>        <entity>            <field column="letit" value="BE"/>
>        </entity>
>    </document>
> </dataConfig>
>
> In the course of this, I did not find a DTD or Schema for <dataConfig>.
>
> Any hint is appreciated!!
>
>
>
>


-- 
Regards,
Shalin Shekhar Mangar.

dataConfig DTD or schema

Posted by Hans-Peter Stricker <st...@epublius.de>.
I wonder how to pass default values via <dataConfig>, e.g. like this:

<dataConfig>
    <dataSource />
    <document>
        <entity> 
            <field column="letit">BE</field>
        </entity>
    </document>
</dataConfig>

or like this:

<dataConfig>
    <dataSource />
    <document>
        <entity> 
            <field column="letit" value="BE"/>
        </entity>
    </document>
</dataConfig>

In the course of this, I did not find a DTD or Schema for <dataConfig>.

Any hint is appreciated!!