w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
solr faceted search - how do I specify multiple fields on the Solr Query UI?
When you execute the search in the Solr Query UI, it will show the actual url that is being sent to Solr above the results pane. Click on that url and it will open a new window in your browser to that url. From there you can add additional parameters to the url to get facteing on multiple fields, by adding additional &facet.field=<your field> entries. Please see the Solr Faceting Parameters reference for more details and other options.

Categories : Solr

Mysql Search vs. Search Tools (CloudSearch,Sphinx,Solr..) For NonText Searches
Most of search servers will not only search but also filter big amounts of data faster than database. So, if you need a better performance, go with a search server. Another thing to consider is a development cost: any search server requires some effort to configure it and integrate with a system. I have some experience with Sphinx and I like it. Now I'm trying to integrate its realtime indexes with ORM and avoid any database filtering. Sphinx will search and filter data, return found IDs and InnoDB will just select data by IDs (MySQL and especially InnoDB tables do it really fast). Just ask yourself "Will DB performance be enough for us?" and make a decision.

Categories : Search

Configure Solr's select search handler to use a custom search component
These Components are enabled by default check SearchComponent Instead of adding it to the defaults you can easily add it to the request handler <requestHandler name="/select" class="solr.SearchHandler"> <!-- add my elevator component to the end of the default list --> <arr name="last-components"> <str>custom-component</str> </arr> </requestHandler> Define the Search Component in your solrconfig.xml and you can use it then refer presentation

Categories : Solr

Include singular search results when search for plural in Solr
You need to apply stemming to your indexed fields in order to achieve this behavior. Please see the Stemming Wiki Page for a complete explanation and an example fieldType to support stemming.

Categories : Solr

Search a strict value in a Solr multivalued search
You need to work on the count of the multivalued field. However, There is no function query to work on the count of the field. So you would need to either store the count of the field from the client side or probably check the AAA to add it automatically so that you can query source:X AND length=1

Categories : Search

Advance search with solr search
Solr does provide the ability to Search for various combinations. Include these words - Solr allows to search for words not in entirely within the document. The match operator can be set to OR (search for any words) instead of AND (all the words). Also, if you use Edismax query parsers, you would be able to configure mm parameter to specify the conditions for word match. Match exact phrase - Solr allows to use double quotes "" to indicate a Exact match search. Do Not Include these Keywords - Solr supports boolean operators and with NOT (-) keywords can be specified which should not be in the documents resulted from the search. e.g. cat NOT dog will return documents with cat but NOT dog in the fields searched for.

Categories : Java

How to search via character matching with a skip distance?
I do not know about the method you posted, but you can use this instead. I've used string and char array for this: public boolean checkString (String s) { char[] check = {'c','a','t'}; int skipDistance = 2; for(int i = 0; i< (s.length() - (skipDistance*(check.length-1))); i++) { boolean checkValid = true; for(int j = 0; j<check.length; j++) { if(!(s.charAt(i + (j*skipDistance))==check[j])) { checkValid = false; } } if(checkValid) return true; } return false; } Feed the pattern to match in the char array 'check'. String "adecrayt" evaluates true. String "cat" evaluates false. Hope this helps. [This part was for fixed skip distance] +++++++++++++

Categories : Java

Solr Geo based search
First of all - Solr will not have this type of queries from the box. So, I see two ways - boost up fields with GPS location, so, matching with them will give you more boost, and results will get higher score, or probably write your own type of query, so you could measure the distance between needed location and location in docments you check for match. Second way - actually - not related to Solr, but I've work with MongoDB a little, and it have geosearch feature. For more information check this (http://docs.mongodb.org/manual/reference/command/geoNear/)

Categories : Solr

Solr set Default search fields
If you look at the default solrconfig.xml file that comes with Solr, you will see that the /select requestHandler is configured with the default search field as <str name="df">name</str> in the <lst name="defaults"> </lst> tag. You can also mark which requestHandler do you want to be used by default using default="true". For more information have a look here

Categories : Search

SOLR - Limiting Search Results
You can use the Sort By Function. You will have to query the normal way with rows=100 and also add the &sort=<query>. I could not try it as I do not have a Solr instance right now. Please let me know if ti works or not.

Categories : Solr

'Jump Url' in solr search results
What you are looking for is then a type of "sponsored search". Something similar to that in Solr can be achieved with the QueryElevationComponent. You need to configure it in your solrconfig.xml, then make a dedicated field to use it and then create an external xml file with your special words and rules you want to apply, for example: <elevate> <query text="AAA"> <doc id="A" /> <doc id="B" /> </query> <query text="ipod"> <doc id="A" /> <!-- you can optionally exclude documents from a query result --> <doc id="B" exclude="true" /> </query> </elevate> And then use it in this way: http://host/solr/elevate?q=YYYY&debugQuery=true&enableElevation=true If you want to return only t

Categories : Solr

Solr - Get DocID of search result
As per this link, Solr does not need a unique id. What you want is the Lucence doc id. However, leaking internal Lucene implementation details is bad, especially since Lucene doc id's change when the index is mutated. What you can do is, while entering data you can add an incrementing field which you could use to perform what you want to.

Categories : Solr

SOLR Facet Search Results
you can check for Solr Pivot Faceting which will provide you with hierarchy facets. You can check if you get the pages, the summing can be done at Client side.

Categories : Solr

solr, how to search two type data?
sort by start_date with the sortMissingLast option enabled on the field. This will cause all the results with blank start_date to be pushed at the end. You would lose the scoring however. Boost on the basis of existence of the field start_date:[* TO *]^10 (with edismax use bq) so that the results would be pushed up if the field has any value.

Categories : Solr

Solr preserve whitspace search
Would be nice to know what kind of application needs such a search :-). You can do the following: if your search term has no spaces, use your existing field searchterm. to help with search queries that have space(s) in them, create a new copyField (say called newsearchterm) which uses EdgeNGramFilterFactory instead of NGramFilterFactory. For newsearchterm the analysis will happen this way: alpha beta ==> alp, alph, alpha, bet, beta so a search newsearchterm:(alpha AND eta) won't match alpha beta.

Categories : Solr

Solr search apostrophe issue
solr.WhitespaceTokenizerFactory creates tokens of characters separated by splitting on whitespace. solr.StandardTokenizerFactory leaves in-word apostrophes as well.

Categories : Solr

Solr search in multiple collections
you can check for Solr distributed search, which will allow you to search across Collections. However, be sure you are maintaining common fields in both the cores so that the query finds them and returns them. Also, distributed search also has some limitations. Else, you need to query differently and consolidate the results.

Categories : PHP

Which is better Apache solr or Elastic search?
Disclaimer: I work at elasticsearch.com I would just say: give elasticsearch a try. I think that after some hours (minutes?), you will have somehow an opinion. Start 2 or 3 or 4 nodes, and you will see how things are rebalanced nicely. About performance, I'd say that elasticsearch will give you a constant query throughput even if you are doing massive index operations.

Categories : Performance

solr doesn't search in all fields
Solr doesn't allow * in the fields search as a replacement for all fields. There is JIRA SOLR-4493 but no plans to fix it as well. You would need to copy the fields you want to search on to a single field with the copyfield directive and search on that field. Also copyfield with source * is not yet supported. JIRA SOLR-4729 is not yet released, but you can try the patch. You have to add individual fields or use a single field for all incoming fields.

Categories : Solr

Search in solr with special characters
To search for your exact phrase put inverted commas round it: select?q=title:"Titanic - 1999" If you just want to search for that special character then you will need to escape it: select?q=title:- Also check: Special Characters not working in SOLR Query If you know exactly which special characters you dont want to use then you can add this to the regex-normalize.xml <regex> <pattern>&#x2D;</pattern> <substitution>%2D</substitution> </regex> This will replace all "-" with %2D, so when you search, as long as you search for %2D instead of the "-" it will work fine

Categories : Search

how to join and search all the fields in solr?
Usually you'd implement this by either using copyField-directives to add all the terms into one field and search on that field, or by supplying a qf= parameter to give the fields you'd want to search (with *dismax). If you're going to do a lot of these you might want to create a separate core and index pre-processed data into that, with copyField directives to create a catch all-field.

Categories : Solr

Solr - Search by the first part of text
It is not possible to use wildcards for phrases. You can instead use the prefix query parser for your fields of string type: http//www.domain.com:8080/solr/select?q={!prefix f=title}Who is Note, that this solution is case-sensitive, so if you want to search for "who is", you should lower-case your fields, when you add documents to Solr and do lower-casing of the query in your program as well.

Categories : SQL

Partial search in solr same as sql Like %que% in Drupal 6
Lucene supports wild card queries which allow you to perform searches such as book*, which will find documents containing terms such as book, bookstore, booklet, etc. Lucene refers to this type of a query as a 'prefix query'. Lucene also supports wild card queries which allow you to place a wild card in the middle of the query term. For instance, you could make searches like: mi*pelling. That will match both misspelling, which is the correct way to spell this word, as well as mispelling, which is a common spelling mistake. Another wild card character that you can use is '?', a question mark. The ? will match a single character. This allows you to perform queries such as Bra?il. Such a query will match both Brasil and Brazil. Lucene refers to this type of a query as a 'wildcard query'.

Categories : PHP

SOLR search by external fields
I would repeat the advice offered by the referenced question, with a qualification. For Solr < 4.0 the two approaches to consider are: Doing the DocumentID lookup before querying solr, and querying solr with a list of document ids (e.g. fq=(docid:1 OR docid:5)) Creating your own derived SolrQueryParser which performs the database query to substitute document ids for attribute ids (e.q. fq=attribute:1 is expanded by the queryparser to fq=(docid:1 OR docid:5)) The decision should revolve around the numer of document ids you'll be sending to Solr. For small, or event moderate (let's say hundreds) of document IDs then sending the IDs as a filterQuery is likely the best way to go. If you're potentially sending a large or very large number of documentids then extending a queryparser

Categories : Solr

Fulltext search with OR using Sunspot/SOLR
Yes, it doesn't work. But you could use logically expression instead. Like "AND" "OR" "+" "-" ... etc. In you case, try s = Product.search do fulltext "Term A OR Term B" end It's works to me.

Categories : Ruby On Rails

do solr-4.3.1 can be used for indexed search in hbase-0.94.6.1?
Did you put hbase all lib jar files into solr/lib ? Many references don't have enough data for Solr + HBase information HBase is NoSQL database, maybe it couldn't support JDBC Driver to let DataImportHandler work.

Categories : Solr

Drupal with Near Realtime Search Solr
I have implemented NRS on various applications using the DIH by requesting delta-import command. Basically how it works is it keeps a timestamp record of when the last import was performed, and in your delta query you filter based on that timestamp. I have a job that tickles the delta command once every 5 minutes, but you could set the interval for what ever your requirement is. Examples here. DataImportHandler Wiki Look for Delta-Import command.

Categories : Drupal

Solr Spatial search with self-intersecting polygons
No, not really. You can use JTS on the client to clean up your polygon so that when Solr gets it, it's valid. See http://tsusiatsoftware.net/jts/jts-faq/jts-faq.html#G

Categories : Search

Solr - How to get search result in specific format
If you don't like the idea of using XsltResponseWriter (which can help int outputting the results in JSON as well), you can create your own SearchComponent, which will modify the output. When you use a custom SearchComponent you can apply different ResponseWriters to the output (xml, json, csv, xslt, etc.). You can learn how to create a custom SearchComponent in this article, for example. To use XsltResponseWriter, add this code to solrconfig.xml: <queryResponseWriter name="xslt" class="org.apache.solr.response.XSLTResponseWriter"/> Add a json.xsl file to conf/xslt folder, which has transformation rules for your XML output (when you use wt=xml in your query), something like this: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www

Categories : Json

advanced search using HayStack + Solr in Django?
I've replied to your various questions as inline responses. but when searched python flask it results in nothing. I want 2nd and 3rd result again, as there is python keyword. You want to change the haystack operator from AND to OR. See http://django-haystack.readthedocs.org/en/v2.1.0/settings.html#haystack-default-operator for more information. when searched boot no result, but it should show 1st result, it has boot in bootstrap word. Look at NgramField and EdgeNgramField for partial matching. when searched pyton again no result, but it should show 2nd and 3rd result, since it only 1 char h missing from python. Look at haystack's spelling suggestions: http://django-haystack.readthedocs.org/en/latest/searchqueryset_api.html#spelling-suggestion when searched boots

Categories : Python

How to check if spatial search is working in Solr
You should store the latitude and longitude in the same field, separated by comma. E.g. <latitude>,<longitude> Field type should be location. <dynamicField name="*_coordinate" type="location" indexed="true" stored="true"/> Pass in the following parameters in your query: pt - The Point to use as the center of the filter. Specified as a comma separated list of doubles. It is lat,lon. d - The distance (in KM) from the point to the outer edge of whatever is being used to filter on sfield - The field with coordinate. The following sample gespatial query will return all locations within 5km of the specified point 49.9641523, 10.1378365 http://localhost:8080/solr/select?q=*:*&fq={!geofilt}&pt=49.9641523,10.1378365&sfield=location_coordinate&d=5

Categories : PHP

Search by part of word with solr dismax
Check for EdgeNGramFilterFactory filter <filter class="solr.EdgeNGramFilterFactory" minGramSize="3" maxGramSize="25" side="front"/> EdgeNGramFilterFactory generates edge grams for the token e.g. word would generate -> wo, wor, word ..... You can use this at index time to generate the tokens. So when you search for wor, documents with word would match However, if you want to search in the mid of the words check for NGramFilterFactory

Categories : Search

Solr search on functional query output
Not sure if any better way to perform this. But, you can check for the Filter query support of function queries with FunctionRangeQParserPlugin e.g. Filter query example: fq={!frange l=0 u=0.99}if(and(tf(MSTATUS_FILTER,Y),if(tf(PARTNER_MSTATUS,$loggedInProfileObj->getMSTATUS()),0,1)),1,0)

Categories : Solr

One-to-Many Geospatial Search Index Design in Solr
The geospatial multi-valued data is handled easily via location_rpt in Solr's out of the box schema. The trickier part here is the weighted tags. As a first cut, I'd index 3 fields, tags05 tags10 tags15, each with 3 separate query-time boosts (via edismax's qf param) of 0.5, 1.0, and 1.5 respectively. This is a discretization approach in which you loose some of the weight fidelity depending on how many buckets you have (3 shown here). If you can, avoid Solr 4 JOIN queries; they are often quite slow. The IDF scores would be a little bad due to the data being split up, so you might want to try a different similarity implementation for these fields that don't consider IDF, perhaps.

Categories : Mysql

Best way to search dynamic list of fields using Solr?
you can check for Request handler with edismax and with default configuration qf which would search on the copyfield which holds data from all the fields. qf query field on which the query would be executed. You would just need to pass a single param to solr qt=edismax&q=K1 K2 for search. <requestHandler name="edismax" class="solr.SearchHandler" > <lst name="defaults"> <str name="defType">edismax</str> <str name="qf"> all_fields </str> <str name="fl"> *,score </str> <str name="q.alt">*:*</str> </lst> </requestHandler> If the user wants to search on name or purpose, i would suggest just passing the fields and the query t

Categories : Solr

SOLR search array vs individual documents
Document organisation : better to have a document approche with : - location - activity - other things needed! location You should save your location like this Country:state:city:suburb.... so that you can seach in usa:new york:new york* of ::new york No need for _ avoid that, there is no needs ! activity activity should be stored in another field for precision on the search and speed.

Categories : Solr

solr: how to search for date ranges with at least X days?
As a general advice: precalculate as much as you can, store the data that you are querying for rather than the data you are getting as input. Also, use several indexes based on different entities - if you have the liberty to do so, and if the queries would become simpler and more straight forward. Ok, generalities aside and on to your question. From your example I take it that you currently store in the index if a consultant is not available - probably, because that is what you get as input. But what you want to query is when they are available. So, you should think about storing the availability rather then the non-availability. EDIT: The most forward way to query this is to use the intervals as entities such that you do not have to resort to special SOLR features to query the start

Categories : Solr

Phonetic search with Solr, for Brazilian Portuguese
you should use SynonymFilterFactory : solr documentation #example of synonym definition for brazilian's living people kkk :) copa=>futebol football=> futebol brasil, brazil => brasil Caution : do use this filter on index time . It will have no effect on query time saddly :(

Categories : Solr

Performing EXACT match on SOLR search
You are using StandardTokenizerFactory, which adheres to Word Boundary rules. This would mean that your words get split on spaces. if you want a real exact match, i.e Richard Chase to return documents containing only Richard Chase exactly, then you should you KeywordTokenizerFactory. But as you mention, you want Richard John Chase but not Johnny Chase, it tells me that you want matches for Richard and Chase. You could either search for Richard AND Chase or change your default operator in schema.xml to be AND instead of OR. Beware that this setting is global.

Categories : Solr

Solr DIH indexing is fast but search is very slow
I am assuming that string is defined as solr.StrField in your schema.xml. Since you are having a blob of data, it would possibly be useful to use a field type that has the right set of tokenizers, analyzers and filters. For example, adding a StandardTokenizerFactory keeps tokens to a meaningful value set. An example of the fieldtype definition: <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" omitNorms="true"> <analyzer type="index"> <tokenizer class="solr.StandardTokenizerFactory" /> <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" /> <filter class="solr.LowerCaseFilterFactory" /> </analyzer> </fieldtype> You could try something like

Categories : Solr



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.