Solr query for null values


















Connect and share knowledge within a single location that is structured and easy to search. I am using Facet in my solr implemententation. Facets are display for all the keywords of fields having concrete values. Sample Data for Solr fields. You can use facet. If set to true, this parameter indicates that, in addition to the Term-based constraints of a facet field, a count of all results that match the query but which have no facet value for the field should be computed and returned in the response.

This parameter can be specified on a per-field basis with the syntax of f. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Facet for Empty or null values for any field in Solr Ask Question. Asked 1 year, 7 months ago. If you have many distinct location field values thousands on up?

If you do this in a filter query, then it will be cached and it's perhaps moot. If you want this query to run fast, then at index time you should index a boolean field to indicate if there is a value in this field or not. For a location field solr. LatLonType , use the following filter query: -fieldName:[, TO 90,] the coordinates outside this range are still invalid.

Asked by STW I have a Solr index with a set of coordinates stored as a Location type; I would like to query for documents where this field has a non-null value.

Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 9 years, 7 months ago. Active 4 years, 4 months ago. Viewed 56k times. Add a comment. Active Oldest Votes. Scarabee 5, 5 5 gold badges 26 26 silver badges 51 51 bronze badges. We're trying to use the advanced search in the Content Manager UI in Tridion , and have selected a search based on a schema, and selected a schema field, but want to find all the components where the schema field is blank.

We've tried putting in 'null' and "" in there, but this doesn't seem to work, and the UI won't let us submit the search with no value.

If the component field is not filled in, it will not show up in XML of the component after the component is saved. To verify the same, try saving the component and view the source. If you do not add any value, the source tab will not even have the field. Only once you add a whitespace or some value, the field starts to show up in the source tab.

If you add a space in the field and save the component and then search using advanced search options, you will be able to find the same. In advances options for search by schema select the schema and then in the schema field Name search by just hitting a space bar, it will give the component with blank field.

I tried it in Tridion SP1 and it works fine and finds components where I had given a whitespace in the field. So, to make them searchable, add a default value to the schema, run component synchronizer so that you don't have to open each component after updating the schema and then Solr will be able to search for the same.

Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Ask Question.



0コメント

  • 1000 / 1000