I have an indexed field of type "text" called obj_title in cloudsearch. It's value is
queryevents#abc.com
If I search for ts or *ts* or events or *events*. I get no results. I get results if I search for string queryevents though.
I have tried Simple/Lucene/DisMax query parsers. What do I need to change in order to support Cloudsearch returning results on ts or *ts* or events or *events*
I don't see option to have NgramFilter or EdgeNgramTokenizer field type in Cloudsearch. What am I missing?
Related
I indexed the data in solr from database and want to do a free text search in all the columns indexed.
Do not want to provide column names.
Add a catch-all copyField instruction (for example source="*" dest="_text_"). This will make sure that all content is copied into the _text_ field. Make your queries search against this field.
q=foo bar&qf=_text_
The _text_ field is usually already defined, but otherwise configure it as a text field.
If you are using eDisMax or DisMax parser you can use the qf parameter to indicate what fields will be searched.
The general syntax is (via query string parameters) is:
q="hello+world"&qf=field1+field2+field3&defType=edismax
You can set this value directly on your solr_config.xml so that you don't have to pass it on every request. If you do, then your query will just be:
q="hello+world"&defType=edismax
I want get only document in collection if contain specific field.
For example I try this but it not work:
const exampleCollection = admin.firestore().collection(‘Collection’).doc(‘Doc).collection(‘Subcollection’);
const exampleDoc = await exampleCollection.where(“field”, “>”, “”).get();
const field = await exampleDoc.data().field;
How to do?
Thanks!
You can actually use .orderBy('field') to return only those documents with that field. Firestore will automatically drop documents without that field.
You can perform simple and compound queries in firebase.
documentation: https://firebase.google.com/docs/firestore/query-data/queries#simple_queries
example: .where('field', '>', '10');
Cloud Firestore does not offer any type of query that simply checks to see if a property exists. You have to check if it contains a specific value (==), or a range (greater than, less than), or its array contains some value. In all cases, you need a specific value to compare to. There is also no type of query that looks for data that's not present, as that type of query does not scale in the way the Firestore requires.
This probably means you will need to change your document model to suit the results you need to get.
I am creating an index in Azure Search Service and looking for a way to allow unknown fileds to be submitted. My documents are semi structured, meaning I know few fields up front. But I want the flexibility to be able to add documents with additional fields.
for example:
{
"name":"name1",
"description":"description"
"unknown,_simple":"test",
"unknown_complex": [{
"male":20,
"female":30
}]
}
In the above example, I know about Name and Description fields so they are added to the index with correct mapping. But unknow_simple and unknown_complex types are not know. Users can submit these when they are creating the documents. Right now Azure Search Rest API is complaining with the following error message
The request is invalid. Details: parameters : A resource without a
type name was found, but no expected type was specified. To allow
entries without type information, the expected type must also be
specified when the model is specified
How can I achieve this? Thank you for you help.
Per my understanding , you want to design your index designed as semi structured , "name" and "description" are two fixed fields and with fixed data type. There will be two flexible fields that you are not sure about its data type. In fact, you can define its data type as string.
Let's say you want to store a json object in that filed, just stringizing your json object so that you can set this string value in that field. Converting this value to json when next time you need it .
If you want to query certain field of json object in your Dynamic field, you can just use the json string fragment as query key to search , just as below :
Lets assume that "Description" filed is my Dynamic field and its value is a json string , I can use the key fragment to get result I want. But it is not so elegant though .
I have to use a field "manufacturerName" for both solr search and solr facet in Hybris. While the solr free text search requires the field type to be text, the facet only works properly in string type.
Is there any way to use this same field for both search and facet. I think there is one way by using "copyField" but I searched a lot, and still don't know how to use it?
Any help would be highly appreciated!
PS: On keeping the field type string, free text search doesn't fetch proper results. On keeping the field type text, facet shows truncated values.
Using a copyField instruction is the way to go, but that require you to define an alternative field - meaning you have one field with the type text and the associated tokenization, and one field of the type string which isn't processed in any way. There is no way in Solr to combine these in a single field that I know of.
You'll then use the name of the string field to generate the facets, while you use the other field when you're querying.
<copyField source="text_search_field" dest="string_facet_field" />
You'll then have to refer to the name string_facet_field when you're filtering or faceting on the field. You'll want to filter against the facet field after the user selects a facet, since you otherwise would end up with documents from other facets possibly leaking into your document result set (for example if the facet was "Foo Bar", you'd suddenly get documents that had "Baz Foo Bar Spam" as the facet, since both words are present in the search string.
I was not able to implement the "copyField" approach, but I found another easy way to do this. In solr.impex, I had already added my new field manufacturerNameFacet of type string, but there is a parameter "fieldValueProvider" and "valueProviderParameter". I provided these values as "springELValueProvider" and the field I wanted to use for search and facet "manufacturerName". After a solr full indexing, it worked like a charm. No other setting was required. The search and facet both were working as expected.
I am doing a query with solr where I need to find documents without a given field say 'name' and I am trying following part;
$q=+status:active -name:["" TO *]'
But it sends both all the documents with and without that field.
Can anyone help me figure this out?
the field name is a normal String type and is indexed.
I am using nodejs. Can anyone help me with this
According to docs:
-field:[* TO *] finds all documents without a value for field
Update
I tried it but it sends even the ones with the field non empty
Then my wild quess is that you are using search query q instead of using filter query fq. Since you are using multiple statements in query I assume that q does some extra magic to get the most relevant documents for you, which can lead to returning some non-wanted results.
If you want to get the strict set of results you should use filter query fq instead, see docs.