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 PeterKerk <ve...@hotmail.com> on 2011/01/31 17:03:44 UTC

one column indexed, the other isnt

I have below configuration. Somehow the field KVK IS indexed and the
varstatement column isnt.

I have tried everything:  reloaded schema.xml, reindex...but somehow the
varstatement column remains 'false' even though I KNOW it is true.

The KVK value IS indexed correctly. What else can it be? I dont get any
errors when I do a full-import..



My database:
KVK				nvarchar(50)	
varstatement	bit	


schema.xml
<field name="kvk" type="string" indexed="true" stored="true"/>
<field name="varstatement" type="boolean" indexed="true" stored="true"/>


data-config.xml
<entity name="artist_owner" query="select userid from user_artist_owned
where objectid='${artist.id}'">
	<entity name="user" query="select KVK,varstatement FROM companies c INNER
JOIN aspnet_users au on au.companyid=c.id WHERE au.userid =
'${artist_owner.userid}'">
		<field name="kvk" column="KVK" />
		<field name="varstatement" column="varstatement" />
	</entity>
</entity>
-- 
View this message in context: http://lucene.472066.n3.nabble.com/one-column-indexed-the-other-isnt-tp2389819p2389819.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: one column indexed, the other isnt

Posted by PeterKerk <ve...@hotmail.com>.
I solved it by altering my SQL statement to return a 'true' or 'false' value:
CASE WHEN c.varstatement='False' THEN 'false' ELSE 'true' END as
varstatement 

Thanks! 
-- 
View this message in context: http://lucene.472066.n3.nabble.com/one-column-indexed-the-other-isnt-tp2389819p2399011.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: one column indexed, the other isnt

Posted by Erick Erickson <er...@gmail.com>.
On a very quick test, it looks like every integer value except 1 is
converted to "false" (I haven't looked at the underlying code, but
this sure makes sense).

So my guess is that what's being sent to Solr isn't what you think,
that is the varstatement you get back is something other than 1. I
have no real clue how DIH would return a bit type, perhaps the actual
value transmitted to Solr is...er...different....

So I'd look at two things:
1> Can you coerce the select statement to insure that an int is returned
    for "varstatement".
2> Look at the DIH debug console to see what you can see. This is a
    little-advertised page, see ....solr/admin/dataimport.jsp

Sorry I can't be more help..
Erick

On Mon, Jan 31, 2011 at 5:49 PM, PeterKerk <ve...@hotmail.com> wrote:

>
> Haha, I KNOW that to be very true: "I have done everything correct, its
> this
> stupid computer that doesnt understand me" ;)
>
> Anyway:
>
> <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"
> omitNorms="true"/>
>
> <field name="varstatement" type="boolean" indexed="true" stored="true"/>
>
> The reason I'm  astonished the correct value isnt returned, is because the
> correct KVK number IS returned.
> So in this query: select KVK,varstatement FROM companies c INNER JOIN
> aspnet_users au on au.companyid=c.id WHERE au.userid =
> '${artist_owner.userid}'
>
> I see that the correct KVM number is indexed, but the varstatement value
> remains false even though in the DB it is true..
>
> On top of that I have successfully used the boolean fieldtype for other
> fields as well...
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/one-column-indexed-the-other-isnt-tp2389819p2392732.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: one column indexed, the other isnt

Posted by PeterKerk <ve...@hotmail.com>.
Haha, I KNOW that to be very true: "I have done everything correct, its this
stupid computer that doesnt understand me" ;)

Anyway:

<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"
omitNorms="true"/>

<field name="varstatement" type="boolean" indexed="true" stored="true"/>

The reason I'm  astonished the correct value isnt returned, is because the
correct KVK number IS returned.
So in this query: select KVK,varstatement FROM companies c INNER JOIN
aspnet_users au on au.companyid=c.id WHERE au.userid =
'${artist_owner.userid}'

I see that the correct KVM number is indexed, but the varstatement value
remains false even though in the DB it is true..

On top of that I have successfully used the boolean fieldtype for other
fields as well...


-- 
View this message in context: http://lucene.472066.n3.nabble.com/one-column-indexed-the-other-isnt-tp2389819p2392732.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: one column indexed, the other isnt

Posted by Erick Erickson <er...@gmail.com>.
What is your schema definition for "varstatement"? Please include
the fieldType as well as the field definition.

How do you expect to convert from your bit type to whatever you've
defined in your schema for varstatement (which is boolean?)?

And lastly, how do you KNOW your actual select statement is
returning anything except "false"? Have you seen the results in
your SQL log in your DB or are you simply asserting that there
are true values in your DB? Because I've KNOWN more times
than I care to count that something HAS to be correct.... and
been wrong <G>....

Best
Erick

On Mon, Jan 31, 2011 at 11:03 AM, PeterKerk <ve...@hotmail.com> wrote:

>
> I have below configuration. Somehow the field KVK IS indexed and the
> varstatement column isnt.
>
> I have tried everything:  reloaded schema.xml, reindex...but somehow the
> varstatement column remains 'false' even though I KNOW it is true.
>
> The KVK value IS indexed correctly. What else can it be? I dont get any
> errors when I do a full-import..
>
>
>
> My database:
> KVK                             nvarchar(50)
> varstatement    bit
>
>
> schema.xml
> <field name="kvk" type="string" indexed="true" stored="true"/>
> <field name="varstatement" type="boolean" indexed="true" stored="true"/>
>
>
> data-config.xml
> <entity name="artist_owner" query="select userid from user_artist_owned
> where objectid='${artist.id}'">
>        <entity name="user" query="select KVK,varstatement FROM companies c
> INNER
> JOIN aspnet_users au on au.companyid=c.id WHERE au.userid =
> '${artist_owner.userid}'">
>                <field name="kvk" column="KVK" />
>                <field name="varstatement" column="varstatement" />
>        </entity>
> </entity>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/one-column-indexed-the-other-isnt-tp2389819p2389819.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>