Giter Site home page Giter Site logo

Empty strings shouldn't be indexed about sunburnt HOT 2 OPEN

tow avatar tow commented on August 24, 2024
Empty strings shouldn't be indexed

from sunburnt.

Comments (2)

tow avatar tow commented on August 24, 2024

Not obvious to me - why shouldn't an empty string be indexed?

Or rather - why shouldn't an empty string be stored - an attribute on an object may well be stored in Solr without that field being indexed, and it is a perfectly reasonable thing for an object to have an attribute which is an empty string.

from sunburnt.

mlissner avatar mlissner commented on August 24, 2024

Thanks for the reply.

I guess the way I look at this is that I want one and only one way to know if an attribute has values.

Django itself solves this problem by having the convention that CharFields are never null. So, the only value they can have is "". (As of about Django 1.7, a warning will be issued if your model has a nullable CharField.)

My idea here is along the same lines, but flips it so that blanks are normalized to None. It would also be possible, (though harder, I think?) to make None values into blanks instead.

So, when indexing:

"" None Thoughts
current "" no attr This is OK, but inconsistent
proposed no attr no attr Good, easy to implement, opposite of Django convention
alt proposal "" "" Best? Harder to implement, aligns with Django convention

Thanks again for the reply. Glad to see your involvement in the project.

from sunburnt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.