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 stockii <st...@googlemail.com> on 2013/04/12 09:31:08 UTC

XInclude in data-config.xml

hello.

is it possible to include some entities with XInclude in my data-config.xml?

i tried with this line:
<xi:include href="solr/entity.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />

in my "entity.xml"  is something like:
<entity name="name" query="SELECT * FROM table"></entity>

some ideas, why does not work? 
this blog sounds good for me =( 
http://www.raspberry.nl/2010/10/30/solr-xml-config-includes/



--
View this message in context: http://lucene.472066.n3.nabble.com/XInclude-in-data-config-xml-tp4055487.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: XInclude in data-config.xml

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
Are you sure your original problem is not fixable with resolvable
properties and variable substitutions ${varname}? Because Solr has good
support for that.

Otherwise, check that you have the right relative file path. I am not sure
what the XML processor think it is. Use truss/strace on Unix/Mac and
Process Monitor on Windows. It is often faster to check that to try to
guess.

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, Apr 12, 2013 at 3:31 AM, stockii <st...@googlemail.com> wrote:

> hello.
>
> is it possible to include some entities with XInclude in my
> data-config.xml?
>
> i tried with this line:
> <xi:include href="solr/entity.xml"
> xmlns:xi="http://www.w3.org/2001/XInclude" />
>
> in my "entity.xml"  is something like:
> <entity name="name" query="SELECT * FROM table"></entity>
>
> some ideas, why does not work?
> this blog sounds good for me =(
> http://www.raspberry.nl/2010/10/30/solr-xml-config-includes/
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/XInclude-in-data-config-xml-tp4055487.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: XInclude in data-config.xml

Posted by Sujatha Arun <su...@gmail.com>.
Hi Andre,

In 3.6.1 version when we used the entities in schema.xml for language
analyzers ,it  gave errors on server restart and core would not load .

Regards,
Sujatha


2013/4/12 Andre Bois-Crettez <an...@kelkoo.com>

> On 04/12/2013 09:31 AM, stockii wrote:
>
>> hello.
>>
>> is it possible to include some entities with XInclude in my
>> data-config.xml?
>>
>
> We first struggled with XInclude, and then switched to use custom
> entities, which worked much better for our needs (reusing  common parts
> in several SearchHandlers).
> ex. in solrconfig.xml :
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE config [
> <!ENTITY solrconfigcommon SYSTEM "solrconfig_common.xml">
>         ]>
> <config>
> ...
> <requestHandler name="search" class="solr.SearchHandler" default="true">
> <lst name="defaults">
> &solrconfigcommon;
> </lst>
> ...
>
> </config>
>
> in solrconfig_common.xml :
>
> <!-- XML fragment used as entity in solrconfig.xml -->
> <str name="echoParams">explicit</**str>
> <str name="defType">edismax</str>
> <str name="qf">title^4 description^1</str>
> <str name="q">*:*</str>
> <str name="q.alt">*:*</str>
> <str name="rows">20</str>
> <str name="q.op">AND</str>
> <str name="pf">title~2^2.0</str>
>
> HTH
> André
>
>
> Kelkoo SAS
> Société par Actions Simplifiée
> Au capital de € 4.168.964,30
> Siège social : 8, rue du Sentier 75002 Paris
> 425 093 069 RCS Paris
>
> Ce message et les pièces jointes sont confidentiels et établis à
> l'attention exclusive de leurs destinataires. Si vous n'êtes pas le
> destinataire de ce message, merci de le détruire et d'en avertir
> l'expéditeur.
>

Re: XInclude in data-config.xml

Posted by Andre Bois-Crettez <an...@kelkoo.com>.
On 04/12/2013 09:31 AM, stockii wrote:
> hello.
>
> is it possible to include some entities with XInclude in my data-config.xml?

We first struggled with XInclude, and then switched to use custom
entities, which worked much better for our needs (reusing  common parts
in several SearchHandlers).
ex. in solrconfig.xml :

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE config [
<!ENTITY solrconfigcommon SYSTEM "solrconfig_common.xml">
         ]>
<config>
...
<requestHandler name="search" class="solr.SearchHandler" default="true">
<lst name="defaults">
&solrconfigcommon;
</lst>
...

</config>

in solrconfig_common.xml :

<!-- XML fragment used as entity in solrconfig.xml -->
<str name="echoParams">explicit</str>
<str name="defType">edismax</str>
<str name="qf">title^4 description^1</str>
<str name="q">*:*</str>
<str name="q.alt">*:*</str>
<str name="rows">20</str>
<str name="q.op">AND</str>
<str name="pf">title~2^2.0</str>

HTH
André


Kelkoo SAS
Société par Actions Simplifiée
Au capital de € 4.168.964,30
Siège social : 8, rue du Sentier 75002 Paris
425 093 069 RCS Paris

Ce message et les pièces jointes sont confidentiels et établis à l'attention exclusive de leurs destinataires. Si vous n'êtes pas le destinataire de ce message, merci de le détruire et d'en avertir l'expéditeur.

Re: XInclude in data-config.xml

Posted by Jack Krupansky <ja...@basetechnology.com>.
Is your data-config.xml file located in your Solr "conf" directory?

You have "solr/" at the front of your path, so is the included file really 
in "conf/solr"?

Otherwise, this should work.

Make sure you only have a single XML element in the included file.

-- Jack Krupansky

-----Original Message----- 
From: stockii
Sent: Friday, April 12, 2013 3:31 AM
To: solr-user@lucene.apache.org
Subject: XInclude in data-config.xml

hello.

is it possible to include some entities with XInclude in my data-config.xml?

i tried with this line:
<xi:include href="solr/entity.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />

in my "entity.xml"  is something like:
<entity name="name" query="SELECT * FROM table"></entity>

some ideas, why does not work?
this blog sounds good for me =(
http://www.raspberry.nl/2010/10/30/solr-xml-config-includes/



--
View this message in context: 
http://lucene.472066.n3.nabble.com/XInclude-in-data-config-xml-tp4055487.html
Sent from the Solr - User mailing list archive at Nabble.com.