lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Riemer <>
Subject Get documents having a boolean field:false or not having the field at all
Date Thu, 19 May 2016 15:17:49 GMT

I've introduced a new boolean field "is_deleted_b_ns" on my objects which I index with Solr.
I am using dynamic field definitions ("b" indicating Boolean, "ns" for "not stored").

Since the field did not exist while the index was built, none of my documents currently has
that field indexed.

My queries from now on must always include this new boolean field: either they ask the index
is_deleted_b_ns:false or is_deleted_b_ns:true. However since the field is not yet indexed
both queries return 0 results.

I see two ways I could go from here:

1)      Either rebuild the whole index so that all documents index this newly added field
as well (time consuming) and then above queries will return the expected results.

2)      I think I could ease my query in the way of OR combining: is_deleted_b_ns:false with
-is_deleted_b_ns:[* TO *]

That would mean "give me the documents where the flag is false or where it does not exist
at all"

Doing 1) is ok for now since this is a big change and we're not in production yet. Doing 2)
feels kind of bad since I don't know if it's a big performance hit. Also I don't like it since
it seems like I react to the current state of the index in my program code - someday the index
will be up to date again and then I'd have this broader query logic in my program which is
not needed anymore.

However 1) will be a problem when we are in production someday. Sure, we won't have changes
that big all time to the index schema but one never knows.

What's your opinion on this? May be there is another option as well?

Best regards,

Mit freundlichen Grüßen
Sebastian Riemer, BSc

LITTERA Software & Consulting GmbH
A-6060 Hall i.T., Haller Au 19a
Telefon: +43(0) 50 765 000, Fax: +43(0) 50 765 118
Sitz: Hall i.T., eingetragen beim Handelsgericht Innsbruck,
Firmenbuch-Nr. FN 295807k, geschäftsführender Gesellschafter: Albert Unterkircher

D-80637 München, Landshuter Allee 8-10
Telefon: +49(0) 89 919 29 122, Fax: +49(0) 89 919 29 123
Sitz: München, eingetragen beim Amtsgericht München
unter HRB 103698, Geschäftsführer: Albert Unterkircher

Diese Nachricht kann vertrauliche, nicht für die Veröffentlichung bestimmte und/oder rechtlich
geschützte Informationen enthalten. Falls Sie nicht der beabsichtigte Empfänger sind, beachten
Sie bitte, dass jegliche Veröffentlichung, Verbreitung oder Vervielfältigung dieser Nachricht
strengstens untersagt ist. Sollten Sie diese Nachricht irrtümlich erhalten haben, informieren
Sie bitte sofort den Absender durch Anruf oder Rücksendung der Nachricht und vernichten Sie

This communication may contain information that is legally privileged, confidential or exempt
from disclosure.  If you are not the intended recipient, please note that any dissemination,
distribution, or copying of this communication is strictly prohibited.  Anyone who receives
this message in error should notify the sender immediately by telephone or by return e-mail
and delete this communication entirely from his or her computer.

  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message