My query is pension paid united nation when I do the full text search its giving top results which contains national word instead of nation word, but I want the result should contains all the words in the query, but don't want national instead of that wants nation word should present in the documents.
How to achieve this with SOLR?
I guess you have a stemmer filter (e.g. PorterStemFilterFactory or SnowballPorterFilterFactory) configured in the field type of the field you are querying.
Remove that or user another field. If you need the stemmed field for something else, you can add a new field and field type without stemmer and copy the content there using
<copyField source="..." dest="..."/>
Related
I am creating a report (in Kentico 10) which has 'cascading' parameters. In order to describe my problem, it is sufficient to mention the following report parameters:
Region (North America, Asia Pacific, etc.) - a dropdown driven by a SQL query
Country (US, CA, MX, DE, FR, etc.) - a dropdown driven by a SQL query, limited by the value of the Region field
When viewing the report, I would like for the value chosen in the Region field to affect the contents of the Country field. The SQL code is not a problem, but actually getting the value of the Country field is.
I have configured the Region field with 'Has depending fields' checked.
I have configured the Country field with 'Depends on another field' checked. In the WHERE clause of its SQL query, I reference '{%Region.Value%}'. (per this article) This does not work. Upon further investigation, I found that the result of {%Region.Value%} is "RegionName", which is the field name specified in the Region field's 'Value column' setting.
How do I access the selected value in the Region dropdown, rather than the name of the field whose value is displayed in that dropdown?
A subsequent question would be: After choosing a Region, the page posts back and my Region choice is lost. How do I make it stick?
(Also, it is not acceptable to replace the SQL-driven dropdown with a static list of regions. This needs to be SQL driven, as there are other dependent fields whose possible values are not static.)
Only the value part is passed to your depending field, so if your region SQL query looks like this:
SELECT RegionID, RegionName from Custom_Region
The RegionID is the value of the {%Region.Value%} macro.
If you need to pass the region Name the query would look like this:
SELECT RegionName, RegionName from Custom_Region
What values the 'search-text' can take in the following query?
GET /me/drive/root/search(q='{search-text}')
From experiments, it looks like the {search-text} is a single string that would be searched in the contents of the file. Meaning if the search text is a multiple word sentence then entire sentence is searched rather than individual works in the sentence? Is this right assumption?
Eg: Say If I would like to search 'word1' 'word2' ... 'wordn' then it looks like search query should be issued for all the n words individually. Is there a format/way in which we can search all the n words in single query?
Thanks,
/Girish BK
Searching is phrase based and does not support wildcards or similar search augmentations.
For example, the query /me/drive/search(q='pizza shop') would search for files that contain the phrase "pizza shop" in a filename, a file's metadata, and a file's content.
I have a field url in schema.xml. I need to separate my search results based on this field.
For example
in one search I want results of www.example.com/part1/ actually all results that have this prefix.
for another search I want results from www.example.com, but without all documents containing /part1/ in their url.
How can I achieve this? fq doesn't accept special characters and I don't want to split content with NGramFilterFactory, so that this behaviour should be only at search-time.
The PathHierarchyTokenizerFactory should do what you need, I believe. It splits a path-type string into multiple tokens, building up from the root forwards. See https://cwiki.apache.org/confluence/display/solr/Tokenizers#Tokenizers-PathHierarchyTokenizer for more details.
You can then do a query such as q=path:www.example.com -path:*/part1, assuming that you are using the Path Hierarchy Tokenizer for both index and query analysis on that field.
When choosing 'Add' in CRUD, how best to generate a list of choices to pick from a dropdown?
For U/update - just display what's there...
The field contents starts with a letter, followed by five numeric digits:{A-I,K-N,Z}#####
Each letter has a different 'max' value for the numeric part.
So when adding a new record, I'd like to offer a listbox with one of each letter and that letter's highest numeric value + 10.
So, if the max 'A' as A00120, and max 'B' B00030 (etc) the listbox would have A00130 and B00040.. etc
Save the user having to figure out which is 'next' when generating a new record.
? Thanks,
Mark
This time I'll not be able to come up with ready to use solution, but I must say - everything is possible with ATK4. You just have to customize and extend it to fit your needs :)
Speaking about your question above - I guess you have to split it in multiple parts.
First part is about how to show select box on Create and readonly or disabled field on Update. I guess you can make some custom Form field or pin some action to existing Form Field hook. Not sure exactly what's better in this case.
Second one is about data structure. I believe that this field actually should be 2 fields in DB and maybe (only maybe) merged together in ATK model with addExpression() just for user interface needs to display these 2 fields as one field easily in UI. Maybe such concatenated field will be useful also for searching, but definitely not as only one field stored in DB. Imagine how hard it'll be for DB engine to find max value if such field. Store it like type = letter, num = number and then search like SELECT max(num)+10 FROM t WHERE type='A'
Finally Third part is about how to generate this next number. I read your question 3 times and came to conclusion that actually you don't have to show this +10 numeric value in UI at all if it's hardly predefined anyway. Actually that'll not work correctly if this will be multi-user system which I guess it will. Instead just show simple select box with letters {A-I,K-N,Z} and calculate this next value exactly before inserting data in DB. That can be done using models insert hook. This will be much more appropriate solution and will be better for UI and also more stable because calculated in model not incorrectly in UI part.
hey i am using solr search in my mvc.net application. Now i am doing free search on it but i want this search on specific field.
i.e. - - - i have various field like name, age, email, interest, profile
as i enter some text in search(free search) field i want that it searched only email field on indexed xml. how can i achieve it using free search.
If you need to search documents by a specific field, you can use the "fieldName:value" query format. eg. name:Manish