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 srini <so...@gmail.com> on 2012/04/09 17:45:18 UTC
Solr is indexing but not showing results
The dataimporthandler status is showing it has indexed and 10 documents are
added, but not showing any result when I search for word that is part of
added document. If I give *:* in search it displays all records
example of clob record:
<?xml version="1.0" encoding="UTF-8" ?>
<message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="someurl" xmlns:csp="someurl.xsd" xsi:schemaLocation="somelocation
jar: id="002" message-type="create">
<content>
<dsp:row>
<dsp:channel>100</dsp:channel>
<dsp:role>115</dsp:role>
</dsp:row>
<body>
</body></content></message>
data-config.xml
<document name="doc">
<entity name="MYCONTENT" transformer="ClobTransformer"
query="SELECT CID,XML FROM MYCONTENT">
<field column="CID" name="CID"/>
<field column="XML" clob="true" name="XML"/>
</entity>
</document>
schema.xml
<field name="CID" type="string" indexed="true" stored="true"
required="true"/>
<field name="XML" type="string" indexed="true" stored="true"
required="true"/>
<dynamicField name="*" type="ignored" />
<uniqueKey>CID</uniqueKey>
<defaultSearchField>XML</defaultSearchField>
solrconfig.xml
<requestHandler name="/dataimport"
class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">/data-config.xml</str>
<str name="rows">10</str>
</lst>
</requestHandler>
I do not why it is not showing result when I search for "Java" "ASP". Any
help is greatly appreciated.
thanks in advance
srini
--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-is-indexing-but-not-showing-results-tp3897176p3897176.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Solr is indexing but not showing results
Posted by srini <so...@gmail.com>.
Thank you Walter and Jeevanandam. your responses have helped me and pushed me
further into the topic. As per your suggestions I changed my schema.xml to
as follows
<fieldType name="text_ws2" class="solr.TextField"
positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<charFilter class="solr.HTMLStripCharFilterFactory"/>
</analyzer>
</fieldType>
<field name="XML" type="text_ws2" indexed="true" stored="true"
required="true"/>
Now when I search for a word that is part of xml document it does return the
result which is a great thing. The results contain 2 xml documents out of 10
docs. The result display whole xml content.
Now I want to focus on specific part where my search word resides. Can you
guys throw me some ideas which way to pursue? Do I need to use any XSLT
parser as walter said? or any other easier approach for this? Please guide
me towards examples.
Thank you.
Srini
--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-is-indexing-but-not-showing-results-tp3897176p3898014.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Solr is indexing but not showing results
Posted by Walter Underwood <wu...@wunderwood.org>.
There are some well-understood problems with query-time synonyms. Read about them here:
http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.SynonymFilterFactory
Expanding synonyms at both index and query time causes a different problem, over-counting the score for any term in the synonym map.
wunder
On Apr 9, 2012, at 12:14 PM, Jeevanandam Madanagopal wrote:
> I agree partially, it actually depends. For instance during index time few of the synonyms mapping may or may not expand (for e.g.. frequent data index population from different source). So good apply at index time as well as query time to achieve complete ratio. Mostly of the time I did similar settings to meet customer requirements.
>
> For example:
> -----------------
> Below sample text datatype with synonyms at index & query time (below config has similar analyzer structure of tokenizer & filter; so we can keep commonly one <analyzer> config too.)
>
> <fieldType name="text" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
> <analyzer type="index">
> <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
> <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
> <filter class="solr.LowerCaseFilterFactory"/>
> <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
> <filter class="solr.PorterStemFilterFactory"/>
> </analyzer>
> <analyzer type="query">
> <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
> <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
> <filter class="solr.LowerCaseFilterFactory"/>
> <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
> <filter class="solr.PorterStemFilterFactory"/>
> </analyzer>
> </fieldType>
>
> -Jeevanandam
>
>
> On Apr 10, 2012, at 12:18 AM, Walter Underwood wrote:
>
>> That is not a good configuration. Synonyms should be expanded at index time, not query time. --wunder
>>
>> On Apr 9, 2012, at 11:43 AM, Jeevanandam Madanagopal wrote:
>>
>>> Srini -
>>>
>>> This "text" datatype comes as sample configuration in SOLR distribution. Check this, it may suit your need!
>>>
>>> <fieldType name="text" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
>>> <analyzer type="index">
>>> <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>>> <filter class="solr.StopFilterFactory"
>>> ignoreCase="true"
>>> words="stopwords.txt"
>>> enablePositionIncrements="true"
>>> />
>>> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
>>> <filter class="solr.LowerCaseFilterFactory"/>
>>> <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
>>> <filter class="solr.PorterStemFilterFactory"/>
>>> </analyzer>
>>> <analyzer type="query">
>>> <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>>> <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
>>> <filter class="solr.StopFilterFactory"
>>> ignoreCase="true"
>>> words="stopwords.txt"
>>> enablePositionIncrements="true"
>>> />
>>> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
>>> <filter class="solr.LowerCaseFilterFactory"/>
>>> <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
>>> <filter class="solr.PorterStemFilterFactory"/>
>>> </analyzer>
>>> </fieldType>
>>>
>>>
>>> -Jeevanandam
>>>
>>> On Apr 10, 2012, at 12:08 AM, Walter Underwood wrote:
>>>
>>>> You will need to define or customize a field type for text.
>>>>
>>>> The example schema.xml file that is installed with Solr 3.5 has a several kinds of text fields, "text_general" and "text_en" are good places to start. You can use one of those, then customize it.
>>>>
>>>> wunder
>>>>
>>>> On Apr 9, 2012, at 11:27 AM, srini wrote:
>>>>
>>>>> Hi Thanks for your reply. As per your suggestion I changed XML field type to
>>>>> text.
>>>>>
>>>>> <field name="XML" type="string" indexed="true" stored="true"
>>>>> required="true"/>
>>>>>
>>>>> but when I start solr it is throwing following exception.
>>>>> SEVERE: org.apache.solr.common.SolrException: Unknown fieldtype 'text'
>>>>> specified on field XML
>>>>>
>>>>> Any suggestions!!(Thanks for your reply)
>>>>>
>>>>> --
>>>>> View this message in context: http://lucene.472066.n3.nabble.com/Solr-is-indexing-but-not-showing-results-tp3897176p3897626.html
>>>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>>
>>
>>
>>
>>
>
--
Walter Underwood
wunder@wunderwood.org
Re: Solr is indexing but not showing results
Posted by Jeevanandam Madanagopal <je...@myjeeva.com>.
I agree partially, it actually depends. For instance during index time few of the synonyms mapping may or may not expand (for e.g.. frequent data index population from different source). So good apply at index time as well as query time to achieve complete ratio. Mostly of the time I did similar settings to meet customer requirements.
For example:
-----------------
Below sample text datatype with synonyms at index & query time (below config has similar analyzer structure of tokenizer & filter; so we can keep commonly one <analyzer> config too.)
<fieldType name="text" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
</fieldType>
-Jeevanandam
On Apr 10, 2012, at 12:18 AM, Walter Underwood wrote:
> That is not a good configuration. Synonyms should be expanded at index time, not query time. --wunder
>
> On Apr 9, 2012, at 11:43 AM, Jeevanandam Madanagopal wrote:
>
>> Srini -
>>
>> This "text" datatype comes as sample configuration in SOLR distribution. Check this, it may suit your need!
>>
>> <fieldType name="text" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
>> <analyzer type="index">
>> <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>> <filter class="solr.StopFilterFactory"
>> ignoreCase="true"
>> words="stopwords.txt"
>> enablePositionIncrements="true"
>> />
>> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
>> <filter class="solr.LowerCaseFilterFactory"/>
>> <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
>> <filter class="solr.PorterStemFilterFactory"/>
>> </analyzer>
>> <analyzer type="query">
>> <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>> <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
>> <filter class="solr.StopFilterFactory"
>> ignoreCase="true"
>> words="stopwords.txt"
>> enablePositionIncrements="true"
>> />
>> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
>> <filter class="solr.LowerCaseFilterFactory"/>
>> <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
>> <filter class="solr.PorterStemFilterFactory"/>
>> </analyzer>
>> </fieldType>
>>
>>
>> -Jeevanandam
>>
>> On Apr 10, 2012, at 12:08 AM, Walter Underwood wrote:
>>
>>> You will need to define or customize a field type for text.
>>>
>>> The example schema.xml file that is installed with Solr 3.5 has a several kinds of text fields, "text_general" and "text_en" are good places to start. You can use one of those, then customize it.
>>>
>>> wunder
>>>
>>> On Apr 9, 2012, at 11:27 AM, srini wrote:
>>>
>>>> Hi Thanks for your reply. As per your suggestion I changed XML field type to
>>>> text.
>>>>
>>>> <field name="XML" type="string" indexed="true" stored="true"
>>>> required="true"/>
>>>>
>>>> but when I start solr it is throwing following exception.
>>>> SEVERE: org.apache.solr.common.SolrException: Unknown fieldtype 'text'
>>>> specified on field XML
>>>>
>>>> Any suggestions!!(Thanks for your reply)
>>>>
>>>> --
>>>> View this message in context: http://lucene.472066.n3.nabble.com/Solr-is-indexing-but-not-showing-results-tp3897176p3897626.html
>>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>
>
>
>
>
Re: Solr is indexing but not showing results
Posted by Walter Underwood <wu...@wunderwood.org>.
That is not a good configuration. Synonyms should be expanded at index time, not query time. --wunder
On Apr 9, 2012, at 11:43 AM, Jeevanandam Madanagopal wrote:
> Srini -
>
> This "text" datatype comes as sample configuration in SOLR distribution. Check this, it may suit your need!
>
> <fieldType name="text" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
> <analyzer type="index">
> <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> <filter class="solr.StopFilterFactory"
> ignoreCase="true"
> words="stopwords.txt"
> enablePositionIncrements="true"
> />
> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
> <filter class="solr.LowerCaseFilterFactory"/>
> <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
> <filter class="solr.PorterStemFilterFactory"/>
> </analyzer>
> <analyzer type="query">
> <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
> <filter class="solr.StopFilterFactory"
> ignoreCase="true"
> words="stopwords.txt"
> enablePositionIncrements="true"
> />
> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
> <filter class="solr.LowerCaseFilterFactory"/>
> <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
> <filter class="solr.PorterStemFilterFactory"/>
> </analyzer>
> </fieldType>
>
>
> -Jeevanandam
>
> On Apr 10, 2012, at 12:08 AM, Walter Underwood wrote:
>
>> You will need to define or customize a field type for text.
>>
>> The example schema.xml file that is installed with Solr 3.5 has a several kinds of text fields, "text_general" and "text_en" are good places to start. You can use one of those, then customize it.
>>
>> wunder
>>
>> On Apr 9, 2012, at 11:27 AM, srini wrote:
>>
>>> Hi Thanks for your reply. As per your suggestion I changed XML field type to
>>> text.
>>>
>>> <field name="XML" type="string" indexed="true" stored="true"
>>> required="true"/>
>>>
>>> but when I start solr it is throwing following exception.
>>> SEVERE: org.apache.solr.common.SolrException: Unknown fieldtype 'text'
>>> specified on field XML
>>>
>>> Any suggestions!!(Thanks for your reply)
>>>
>>> --
>>> View this message in context: http://lucene.472066.n3.nabble.com/Solr-is-indexing-but-not-showing-results-tp3897176p3897626.html
>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
Re: Solr is indexing but not showing results
Posted by Jeevanandam Madanagopal <je...@myjeeva.com>.
Srini -
This "text" datatype comes as sample configuration in SOLR distribution. Check this, it may suit your need!
<fieldType name="text" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="stopwords.txt"
enablePositionIncrements="true"
/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="stopwords.txt"
enablePositionIncrements="true"
/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
</fieldType>
-Jeevanandam
On Apr 10, 2012, at 12:08 AM, Walter Underwood wrote:
> You will need to define or customize a field type for text.
>
> The example schema.xml file that is installed with Solr 3.5 has a several kinds of text fields, "text_general" and "text_en" are good places to start. You can use one of those, then customize it.
>
> wunder
>
> On Apr 9, 2012, at 11:27 AM, srini wrote:
>
>> Hi Thanks for your reply. As per your suggestion I changed XML field type to
>> text.
>>
>> <field name="XML" type="string" indexed="true" stored="true"
>> required="true"/>
>>
>> but when I start solr it is throwing following exception.
>> SEVERE: org.apache.solr.common.SolrException: Unknown fieldtype 'text'
>> specified on field XML
>>
>> Any suggestions!!(Thanks for your reply)
>>
>> --
>> View this message in context: http://lucene.472066.n3.nabble.com/Solr-is-indexing-but-not-showing-results-tp3897176p3897626.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>
>
>
>
>
Re: Solr is indexing but not showing results
Posted by Walter Underwood <wu...@wunderwood.org>.
You will need to define or customize a field type for text.
The example schema.xml file that is installed with Solr 3.5 has a several kinds of text fields, "text_general" and "text_en" are good places to start. You can use one of those, then customize it.
wunder
On Apr 9, 2012, at 11:27 AM, srini wrote:
> Hi Thanks for your reply. As per your suggestion I changed XML field type to
> text.
>
> <field name="XML" type="string" indexed="true" stored="true"
> required="true"/>
>
> but when I start solr it is throwing following exception.
> SEVERE: org.apache.solr.common.SolrException: Unknown fieldtype 'text'
> specified on field XML
>
> Any suggestions!!(Thanks for your reply)
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Solr-is-indexing-but-not-showing-results-tp3897176p3897626.html
> Sent from the Solr - User mailing list archive at Nabble.com.
Re: Solr is indexing but not showing results
Posted by srini <so...@gmail.com>.
Hi Thanks for your reply. As per your suggestion I changed XML field type to
text.
<field name="XML" type="string" indexed="true" stored="true"
required="true"/>
but when I start solr it is throwing following exception.
SEVERE: org.apache.solr.common.SolrException: Unknown fieldtype 'text'
specified on field XML
Any suggestions!!(Thanks for your reply)
--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-is-indexing-but-not-showing-results-tp3897176p3897626.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Solr is indexing but not showing results
Posted by Ahmet Arslan <io...@yahoo.com>.
> <field name="CID" type="string" indexed="true"
> stored="true"
> required="true"/>
> <field name="XML" type="string" indexed="true"
> stored="true"
> required="true"/>
String type is not tokenized. Indexed verbatim. Use a different type for full text search. e.g. type="text"