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 Udaya <uk...@gmail.com> on 2009/03/31 15:34:19 UTC

Your attention is needed! Solr to be used with a web application.

I am a new bee to Solr and till date my experience with Solr is great.

1.   I am trying to use Solr v1.3 in a web application which is deployed
into Tomcatv6.0. I am 
doing this with reference to the example-DIH thats provided with the solr
download.
2.   The web application(with name TestSolr) has only one HTML page in it
which is created with reference to the source code of the
http://rss.slashdot.org/Slashdot/slashdot.
3.   The solr configuration xml files are placed inside the directory
structure 
C:\web1\solr1\test\DIH\conf.
4.   The configuration files that are places inside the conf folder are 
admin-extra.html,protword.txt,stopwords.txt,synonyms.txt,dataconfig.xml,elevate.xml,schema.x
ml,solrconfig.xml,script.conf(These files are modified with respect to the
web 
application"TestSolr")
5.    I have set the java option in tomcat configuration as 
-Dsolr.solr.home=C:\web1\solr1\test(It is here that the solr.xml and DIH
folder are located 
inside which the conf folder is located)

When I try to run the apache-solr-1.3.war thats deployed in the tomcat, it
results to 
"Welcome to Solr" page with a "Solr Admin" hyper link in it. When clicking
on "Solr Admin" 
it results to an error page"HTTP Status 404 - missing core name in path"


The changes that i have made to the configuration XML files are as follows
(a)  I have made 1 Change to solrconfig.xml as follows
<requestHandler name="/dataimport"
   	class="org.apache.solr.handler.dataimport.DataImportHandler">
   	<lst name="defaults">
   		<str name="config">dataconfig.xml</str>
   	</lst>
   </requestHandler> other than this its the same as like the solrconfig.xml
thats inside 
the example-DIH\solr\rss\conf folder.
(b)  dataconfig.xml is as follows
<dataConfig>
        <dataSource type="HttpDataSource" />
        <document>
                <entity name="Test"
			pk="id"
                        url="http://localhost:8080/TestSolr"
                        processor="XPathEntityProcessor"
                        forEach="/RDF/channel | /RDF/item"
                        transformer="DateFormatTransformer">

                <field column="source" xpath="/RDF/channel/title"
commonField="true" />
                <field column="source-link" xpath="/RDF/channel/link"
commonField="true" />
                <field column="subject" xpath="/RDF/channel/subject"
commonField="true" />
		<field column="id" xpath="/RDF/channel/id" commonField="true"/>

                <field column="title" xpath="/RDF/item/title" />
                <field column="description" xpath="/RDF/item/description" />
                <field column="creator" xpath="/RDF/item/creator" />
                <field column="item-subject" xpath="/RDF/item/subject" />
                <field column="date" xpath="/RDF/item/date" 
dateTimeFormat="yyyy-MM-dd'T'hh:mm:ss" />
                </entity>
        </document>
</dataConfig>
(c)   In scheme.xml i have created the required fieldtypes and fields.

Please help me to make Solr to interact with the web application.
I do have few questions your suggestions about them would be of great help
1.   Is it possible to achieve the above said goal.
2.   Am I moving in the right direction.
3.   What are the changes that I have to do in order to achieve the above
said goal.
4.   Any suggestion or reference material would be of great help.
5.   How is that I can index the web application and search in it.

Thanks,
Udaya


-- 
View this message in context: http://www.nabble.com/Your-attention-is-needed%21-Solr-to-be-used-with-a-web-application.-tp22804930p22804930.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Your attention is needed! Solr to be used with a web application.

Posted by Udaya <uk...@gmail.com>.
Hi Noble Paul,
I am a beginner  in solr pls don't mistake me if I am wrong,
Multicore in the sense using Database and HTTPdatasource(like web site or
rss feed) or any other combination of datasources to get data, is it right?
If yes then I am not trying to do it.
I am only tying to configure the HTTPdatasource(web application which has a
web page in it) with Solr.
Your suggestions about configuring the web app with the Solr would be
useful...
If my understanding abt multicore is wrong can you pls direct me to the
right resource to understand the same.

Thanks,
Udaya



Noble Paul നോബിള്‍  नोब्ळ् wrote:
> 
> do you really need a multicore configuration?
> start with a single core first.
> 
> On Wed, Apr 1, 2009 at 10:31 AM, Udaya <uk...@gmail.com> wrote:
>>
>>
>> Shalin Shekhar Mangar wrote:
>>>
>>> On Tue, Mar 31, 2009 at 7:04 PM, Udaya <uk...@gmail.com> wrote:
>>>
>>>>
>>>> 3.   The solr configuration xml files are placed inside the directory
>>>> structure
>>>> C:\web1\solr1\test\DIH\conf.
>>>> 5.    I have set the java option in tomcat configuration as
>>>> -Dsolr.solr.home=C:\web1\solr1\test(It is here that the solr.xml and
>>>> DIH
>>>> folder are located
>>>> inside which the conf folder is located)
>>>>
>>>> When I try to run the apache-solr-1.3.war thats deployed in the tomcat,
>>>> it
>>>> results to
>>>> "Welcome to Solr" page with a "Solr Admin" hyper link in it. When
>>>> clicking
>>>> on "Solr Admin"
>>>> it results to an error page"HTTP Status 404 - missing core name in
>>>> path"
>>>>
>>>
>>> It seems you need only a single Solr index. The solr.xml is needed only
>>> when
>>> you want to use multiple Solr indices -- the example-DIH provides a db
>>> and
>>> an rss example, therefore it uses a solr.xml. Point your solr home to
>>> the
>>> test/DIH directory which contains the conf directory.
>>>
>>> --
>>> Regards,
>>> Shalin Shekhar Mangar.
>>>
>>>
>>
>>
>>
>> Hi Shalin,
>> Thank you,
>> I do added the java option of the tomcat configuration as your suggestion
>> i.e
>> -Dsolr.solr.home=C:\web1\solr1\test\DIH
>> After setting when i tried running the apache-solr-1.3 from tomcat I get
>> the
>> following exceptions
>> 1.org.xml.sax.SAXParseException: Content is not allowed in prolog. at
>> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown
>> Source)........
>> 2.org.apache.solr.handler.dataimport.DataImportHandlerException:
>> Exception
>> occurred while initializing context Processing Document # at
>> org.apache.solr.handler.dataimport.DataImporter.loadDataConfig(DataImporter.java:176)
>> at
>> org.apache.solr.handler.dataimport.DataImporter.<init>(DataImporter.java:93)
>> at ......
>> 3.org.apache.solr.common.SolrException: FATAL: Could not create importer.
>> DataImporter config invalid at
>> org.apache.solr.handler.dataimport.DataImportHandler.inform(DataImportHandler.java:114)
>> at
>> org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:311)
>> at........
>>
>>
>> My tomcat is protected with password, i.e we do have to give the username
>> and password when trying to access the web applications that are deployed
>> in
>> it. My doubt is how do we overcome this when Solr tries to access
>> resource
>> from tomcat?
>> I do tried to add the username and password in the datasource tag of
>> dataconfig.xml as follows
>> <dataSource type="HttpDataSource" user="admin" password="password"/>
>> Even then the exceptions do occur....
>> Suggestions would be of great help....
>> Thanks,
>> Udaya
>> --
>> View this message in context:
>> http://www.nabble.com/Your-attention-is-needed%21-Solr-to-be-used-with-a-web-application.-tp22804930p22819854.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> --Noble Paul
> 
> 

-- 
View this message in context: http://www.nabble.com/Your-attention-is-needed%21-Solr-to-be-used-with-a-web-application.-tp22804930p22820368.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Your attention is needed! Solr to be used with a web application.

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
do you really need a multicore configuration?
start with a single core first.

On Wed, Apr 1, 2009 at 10:31 AM, Udaya <uk...@gmail.com> wrote:
>
>
> Shalin Shekhar Mangar wrote:
>>
>> On Tue, Mar 31, 2009 at 7:04 PM, Udaya <uk...@gmail.com> wrote:
>>
>>>
>>> 3.   The solr configuration xml files are placed inside the directory
>>> structure
>>> C:\web1\solr1\test\DIH\conf.
>>> 5.    I have set the java option in tomcat configuration as
>>> -Dsolr.solr.home=C:\web1\solr1\test(It is here that the solr.xml and DIH
>>> folder are located
>>> inside which the conf folder is located)
>>>
>>> When I try to run the apache-solr-1.3.war thats deployed in the tomcat,
>>> it
>>> results to
>>> "Welcome to Solr" page with a "Solr Admin" hyper link in it. When
>>> clicking
>>> on "Solr Admin"
>>> it results to an error page"HTTP Status 404 - missing core name in path"
>>>
>>
>> It seems you need only a single Solr index. The solr.xml is needed only
>> when
>> you want to use multiple Solr indices -- the example-DIH provides a db and
>> an rss example, therefore it uses a solr.xml. Point your solr home to the
>> test/DIH directory which contains the conf directory.
>>
>> --
>> Regards,
>> Shalin Shekhar Mangar.
>>
>>
>
>
>
> Hi Shalin,
> Thank you,
> I do added the java option of the tomcat configuration as your suggestion
> i.e
> -Dsolr.solr.home=C:\web1\solr1\test\DIH
> After setting when i tried running the apache-solr-1.3 from tomcat I get the
> following exceptions
> 1.org.xml.sax.SAXParseException: Content is not allowed in prolog. at
> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
> at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown
> Source)........
> 2.org.apache.solr.handler.dataimport.DataImportHandlerException: Exception
> occurred while initializing context Processing Document # at
> org.apache.solr.handler.dataimport.DataImporter.loadDataConfig(DataImporter.java:176)
> at
> org.apache.solr.handler.dataimport.DataImporter.<init>(DataImporter.java:93)
> at ......
> 3.org.apache.solr.common.SolrException: FATAL: Could not create importer.
> DataImporter config invalid at
> org.apache.solr.handler.dataimport.DataImportHandler.inform(DataImportHandler.java:114)
> at
> org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:311)
> at........
>
>
> My tomcat is protected with password, i.e we do have to give the username
> and password when trying to access the web applications that are deployed in
> it. My doubt is how do we overcome this when Solr tries to access resource
> from tomcat?
> I do tried to add the username and password in the datasource tag of
> dataconfig.xml as follows
> <dataSource type="HttpDataSource" user="admin" password="password"/>
> Even then the exceptions do occur....
> Suggestions would be of great help....
> Thanks,
> Udaya
> --
> View this message in context: http://www.nabble.com/Your-attention-is-needed%21-Solr-to-be-used-with-a-web-application.-tp22804930p22819854.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>



-- 
--Noble Paul

Re: Your attention is needed! Solr to be used with a web application.

Posted by Udaya <uk...@gmail.com>.

Shalin Shekhar Mangar wrote:
> 
> On Tue, Mar 31, 2009 at 7:04 PM, Udaya <uk...@gmail.com> wrote:
> 
>>
>> 3.   The solr configuration xml files are placed inside the directory
>> structure
>> C:\web1\solr1\test\DIH\conf.
>> 5.    I have set the java option in tomcat configuration as
>> -Dsolr.solr.home=C:\web1\solr1\test(It is here that the solr.xml and DIH
>> folder are located
>> inside which the conf folder is located)
>>
>> When I try to run the apache-solr-1.3.war thats deployed in the tomcat,
>> it
>> results to
>> "Welcome to Solr" page with a "Solr Admin" hyper link in it. When
>> clicking
>> on "Solr Admin"
>> it results to an error page"HTTP Status 404 - missing core name in path"
>>
> 
> It seems you need only a single Solr index. The solr.xml is needed only
> when
> you want to use multiple Solr indices -- the example-DIH provides a db and
> an rss example, therefore it uses a solr.xml. Point your solr home to the
> test/DIH directory which contains the conf directory.
> 
> -- 
> Regards,
> Shalin Shekhar Mangar.
> 
> 



Hi Shalin,
Thank you,
I do added the java option of the tomcat configuration as your suggestion 
i.e
-Dsolr.solr.home=C:\web1\solr1\test\DIH
After setting when i tried running the apache-solr-1.3 from tomcat I get the
following exceptions
1.org.xml.sax.SAXParseException: Content is not allowed in prolog. at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown
Source)........
2.org.apache.solr.handler.dataimport.DataImportHandlerException: Exception
occurred while initializing context Processing Document # at
org.apache.solr.handler.dataimport.DataImporter.loadDataConfig(DataImporter.java:176)
at
org.apache.solr.handler.dataimport.DataImporter.<init>(DataImporter.java:93)
at ......
3.org.apache.solr.common.SolrException: FATAL: Could not create importer.
DataImporter config invalid at
org.apache.solr.handler.dataimport.DataImportHandler.inform(DataImportHandler.java:114)
at
org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:311)
at........


My tomcat is protected with password, i.e we do have to give the username
and password when trying to access the web applications that are deployed in
it. My doubt is how do we overcome this when Solr tries to access resource
from tomcat?
I do tried to add the username and password in the datasource tag of
dataconfig.xml as follows
<dataSource type="HttpDataSource" user="admin" password="password"/> 
Even then the exceptions do occur....
Suggestions would be of great help....
Thanks,
Udaya
-- 
View this message in context: http://www.nabble.com/Your-attention-is-needed%21-Solr-to-be-used-with-a-web-application.-tp22804930p22819854.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Your attention is needed! Solr to be used with a web application.

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Tue, Mar 31, 2009 at 7:04 PM, Udaya <uk...@gmail.com> wrote:

>
> 3.   The solr configuration xml files are placed inside the directory
> structure
> C:\web1\solr1\test\DIH\conf.
> 5.    I have set the java option in tomcat configuration as
> -Dsolr.solr.home=C:\web1\solr1\test(It is here that the solr.xml and DIH
> folder are located
> inside which the conf folder is located)
>
> When I try to run the apache-solr-1.3.war thats deployed in the tomcat, it
> results to
> "Welcome to Solr" page with a "Solr Admin" hyper link in it. When clicking
> on "Solr Admin"
> it results to an error page"HTTP Status 404 - missing core name in path"
>

It seems you need only a single Solr index. The solr.xml is needed only when
you want to use multiple Solr indices -- the example-DIH provides a db and
an rss example, therefore it uses a solr.xml. Point your solr home to the
test/DIH directory which contains the conf directory.

-- 
Regards,
Shalin Shekhar Mangar.