Menu
  • HOME
  • TAGS

Adding a new field to existing Solr index

Tag: search,solr

I'm working with Solr 4.3.0 and I am trying to add a new field to its index.

I have added the field to xml-data-config.xml:

<field column="session_garantie" xpath="/produits/stage/sessions/session/@garantie" />

And I've added the field to schema.xml:

<field name="session_garantie" type="string" indexed="true" stored="true" multiValued="true"/>

But I still don't find my field in the query results. Why? Is there a cache I should clean?

Best How To :

I just rebooted the Solr Core i'm working with. Thanks .

How do I combine Facet and FilterQueries using Spring data Solr?

spring,solr,filtering,facet

I assume you're using Spring Data Solr, from your reference to SimpleFacetQuery. Based on your sample query, the code would look something like this: // creates query with facet SimpleFacetQuery query = new SimpleFacetQuery( new Criteria("lastName").startsWith("Harris")) .setFacetOptions(new FacetOptions() .addFacetOnField("state")); // filter parameters on query query.addFilterQuery(new SimpleFilterQuery( Criteria.where("filterQueryField").is("red"))); // using query...

SQL find same value on multiple filelds with like operator

mysql,sql,search,like,sql-like

You are using the LIKE operator for first_name and last_name as follows: LIKE '%Natalie Fern%' This will only match strings which contain anything followed by 'Natalie Fern' followed by anything. But since the first and last name columns only contain (surprise) the first and last names, your query isn't matching...

How can I add custom search engine to browser?

search,browser,manifest,provider

A couple of steps. First, create an XML file with the information for the search provider. This is an example for Wikipedia: (Named: Wikipedia.xml) <?xml version="1.0" encoding="UTF-8"?> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> <ShortName>Wikipedia</ShortName> <Description>Wikipedia Search</Description> <InputEncoding>UTF-8</InputEncoding> <Url type="text/html" template="http://en.wikipedia.org/w/index.php?title={searchTerms}" />...

Search box/field design with multiple search locations

python,search,design,search-engine,pyramid

What happens to your search interface if the application changes? This is a very important aspect. Do you add another search type? A search returns matches on the query string. A result set can contain different entities from different types. Then your search/resultset interface could apply filtering based on entity...

ElasticSearch- “No query registered for…”

search,indexing,elasticsearch

Write your query like this, i.e. sort needs to go to the top-level and not nested in the querypart: { "query": { "filtered": { "query": { "query_string": { "fields": [ "description" ], "query": "sun" } }, "filter": { "term": { "permissions": 1 } } } }, "sort": [ { "likes_count":...

Get Order Details by Order Id

magento,search,order,magento-1.9

In magento every order has two IDs Order ID - is Magento internal order ID Order Increment ID - is the ID display on communicate (email, etc) with your customer See Confusion with order id, order increment id and I am not getting order id as 20001201 To load order...

Solr 4.10.2 MySQL import fails with java.io.EOFException

mysql,solr

I eventually had to change my.cnf for the new MySQL server. For some reason the new one (also 5.5.43) closed the connection after timeout. I changed the settings for timeout in MySQL and now it indexes correctly, for about 21 minutes. I wished tomcat7 and solr made that more clear...

If statement for search field in Rails

jquery,ruby-on-rails,search,if-statement

The standard way to use a search would be to include a parameter in the URL. That way you can have a similar to if user_signed_in? check for the parameter: if params[:search].present?.

Understanding Apache Lucene's scoring algorithm

search,solr,lucene,full-text-search,hibernate-search

Scoring calculation is something really complex. Here, you have to begin with the primal equation: score(q,d) = coord(q,d) · queryNorm(q) · ∑ ( tf(t in d) · idf(t)2 · t.getBoost() · norm(t,d) ) As you said, you have tf which means term frequency and its value is the squareroot of...

Searching for a sentence in a file java [closed]

java,file,search

You can always use the String#contains() method to search for substrings. Here, we will read each line in the file one by one, and check for a string match. If a match is found, we will stop reading the file and print Match is found! package com.adi.search.string; import java.io.*; import...

Solr custom UpdateRequestProcessorFactory fails with “Error Instantiating UpdateRequestProcessorFactory”

java,solr,lucene,config,solrcloud

The issue is a classloader issue. I had added my custom jar into the server/lib/ folder. When I added the Collection, it would instantiate my custom class which needs the UpdateRequestProcessorFactory class but is not available in that classloader. I solved this by rmoving my jar from server/lib/ and adding...

How to skip a row with file exists condition in laravel

laravel,search,eloquent

Option 1: would be to make an array of the filenames, then utilize the whereIn query builder method, which checks for the occurrence of a column value in an array. $query = Model::query(); $filenames = scandir('/img'); // the following excludes any id's not in the $filenames array $query = $query->whereIn('id',...

How can i search multiple words in a file on Notepad++

search,notepad++

Prolog To help people coming from the search or Google, I write it again as answer. Please mark it as correct answer to improve the speed of finding the correct answer. You can also check the comment section inside the question if something is unclear. Solution Instead of seperating the...

How can I remove delta-homes.com from browsers?

search,registry,malware

Maybe you should try AdwCleaner to clean up your system...

Assigning value to Search Bar Delegate - Swift

ios,swift,uitableview,search

There is no problem with the use of tableView as both a local (to a function) and "global" variable name. If you have a local and a global variable with the same name, the code will access the local variable in preference to the global. If you want to access...

Is it possible to index views in Apache Solr

sql,view,solr

You can use the data import handler and set the "query" to point to your view. See example below: <dataConfig> <dataSource driver="org.hsqldb.jdbcDriver" url="jdbc:hsqldb:/temp/example/ex" user="sa" /> <document name="products"> <entity name="feature" query="SELECT * FROM MyView"> <field column="attr_1" name="Attr1" /> <field column="attr_2" name="Attr2" /> <field column="attr_3" name="Attr3" /> </entity> ...

Searching a TextField and IntField together seperated by an AND condition In Lucene

java,search,indexing,lucene

There are a few possibilities. First, what I would most recommend in this case, is perhaps you don't need those IntFields at all. Zip codes and IDs are usually not treated as numbers. They are identifiers that happen to be comprised of digits. If your zip code is 23456, that...

Lucene vs Solr, indexning speed for sampe data

java,indexing,solr,lucene,full-text-search

Solr is a general-purpose highly-configurable search server. The Lucene code in Solr is tuned for general use, not specific use cases. Some tuning is possible in the configuration and the request syntax. Well-tuned Lucene code written for a specific use-case will always outperform Solr. The disadvantage is that you must...

Can anyone help me make the search bar work as I now have the JS prompt? [on hold]

javascript,html5,search,youtube-api,search-engine

You can just add an onclick listener to the find button and trigger the code when someone clicks. You can get the value of the search input instead of the prompt: Javascript: function search() { var api_key; api_key = "AIzaSyDiUEkwoldcB9qgRreOsaiyu2Nlj8U-03c"; var search_term = document.getElementById("searchterm").value; function onSuccess(data){ console.log(data); var obj =...

Swift ios relational picker views and apple dev guidelines

ios,xcode,swift,uitableview,search

Just a rough sketch: Say you pick a category from you PickerView. Your PickerView should then notify you parent ViewController that the user has picked a Category. The most convenient way to do this is to have a Delegate method, like: self.delegate.userPickedCategory(pickedCategory: Category) Now, I assume you Category object contains...

PHP sum echo result on the fly (difficult)

php,html,mysql,forms,search

Muy bien, maradoiano, tuve que realizar algunas acrobacias para correr tu código, la cosa está así: Para obtener la suma de todas las inversiones sencillamente se necesita una variable que acumule los resultados de todos los (costo * stock), llamémosla $total. Para desplegar este total ARRIBA de la tabla es...

Getting application/json back from a Solr query

java,json,solr,jersey,jersey-client

The wt param, should take care of JSON response format, as per this. However, things can go wrong sometimes, as mentioned like JSON responses can be returned as plain text, with a change in solrconfig.xml. Please check that option also. Hope this helps you in identifying the issue.

Sql string search

sql,string,search,select

Not sure what you're trying to do with the NULL there, but basically you if you want to find a capital that contains the name of the country, the usage of the like operator is definitely in order. Just slap a couple of wildcards (%) around it, and you should...

SOLR - highlight searching text ? Is this possible

solr,solrj,solr-highlight

There is a Solr wiki entry on HighlightingParameters that you should read to get familiar with Solr and Highlighting at: https://wiki.apache.org/solr/HighlightingParameters Specifically, what you should consider is hl.snippets and hl.fragsize. To quote the important part from the wiki: hl.snippets The maximum number of highlighted snippets to generate per field. -...

Rails4 + sunspot search

mysql,ruby-on-rails,solr,sunspot

How are you accessing the result? If you are calling .results method then it will fire db query. You should iterate over hits and get the require field to avoid db query.

Solr 5.1.0 - Apache TikaEntityProcessor Cannot Find My Files

mysql,solr,tika

Try with the below data-config. <dataConfig> <dataSource name="ds-db" type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/EDMS_Metadata" user="root" password="**************" /> <dataSource name="ds-file" type="BinFileDataSource"/> <document name="doc1"> <entity name="db-data" dataSource="ds-db" query="select TextContentURL,ID,Title,AuthorCreator from MasterIndex" > <field column="TextContentURL" name="TextContentURL" /> <field column="Title" name="title"...

Treeview search results flat list

c#,search,treeview

Create a parent node that should be global to the form. so that you can use the parent node without searching the directory (folder) on the harddisk every time. lets say var directoryNode = new TreeNode(directoryInfo.Name); and add all the subsequent nodes to the directoryNode as your code already performing...

sum of rows maximum and minimum is not correct. whats the issue?

c++,arrays,search

With stl, your code may be void rowSum(const int (&array)[10][10]) { int sum[10] = {0}; for(int i = 0; i < 10; ++i) { sum[i] = std::accumulate(std::begin(array[i]), std::end(array[i]), 0); } auto p = std::min_max_element(std::begin(sum), std::end(sum)); std::cout << std::endl << "Row" << std::distance(std::begin(sum), p.first) << "is minimum and having sum of"...

VB.Net - How to dynamicaly search for a string in all TreeView nodes expanding and collapsing nodes matching (or not) the search string?

vb.net,search,treeview,collapse,expand

Following my initial comments, try something like: Private Sub txtFiltroIDs_TextChanged(sender As Object, e As EventArgs) Handles txtFilterToolIDs.TextChanged tviewToolIDs.BeginUpdate() tviewToolIDs.CollapseAll() ClearBackColor() FindByText() tviewToolIDs.EndUpdate() tviewToolIDs.Refresh() End Sub ...

Recursive solution doesn't iterate correctly

ruby,algorithm,search,recursion

The first time you enter the adjacencies[to_append].each, you immediately return from the method, therefore the loop will never be executed more than once. You need to return a list of phone numbers instead of just a single phone number build that list somehow in your recursive call ...

Pagination with PDO MySQL Search Multiple Form Fields

php,mysql,search,pdo,pagination

Your field_oem_value and field_oem_pn_value params are getting lost after clicking on any of the pagination links. You need to specify them explicitly in link's href (or save in session). Do something like this: $params = [ 'field_oem_value' => $oemSearch, 'field_oem_pn_value' => $oempnSearch ]; // The "back" link $prevlink = ($page...

grep first n rows, return file name only

regex,linux,search,grep

You can do: for file in *.xml; do head -200 "$file" | grep -q "mysearchstring" && echo "$file" done ...

Solr 5.1.0: How to set the unique key via Schema API

solr,schema,unique-key

No its not possible as of now. Its an open feature request. https://issues.apache.org/jira/browse/SOLR-7242

How to make a big form?

php,search

For searching you can use MATCH (something) AGAINST ('some words' IN BOOLEAN MODE) ...

Using StringComparer with StringBuilder to search for a string

c#,string,search,stringbuilder,culture

So why not copy the whole document to a stringbuilder first, the use 1 ToString(). Then just use a similar scheme to iterate over all the possible values. Use compareInfo.Compare(criteria.Text, 0, criteria.Text.Length, docString, startIndex, checkLength)

How to index plain text files for search in Sphinx

search,sphinx,plaintext

Have a look at this before proceeding Sphinx without SQL! . Ideally I would do this. We are going to use Sphinx's sql_file_field to index a table with file path. Here is the PHP script to create a table with file path for a particular directory(scandir). <?php $con = mysqli_connect("localhost","root","password","database");...

solrcloud - choosing cores for update and search requests

solr,solrcloud

For both queries and updates, its better if you route it to all 6 servers. For updates you might think its better to route it to leaders, but SolrCloud dynamically selects the leaders for each shard. So depending on number of requests and other operations, leaders will be switched every...

Mysql Fulltext search returns empty result while there are 100+ rows

mysql,search,full-text-search

To answer your first situation i.e. hello returing nothing, its the fulltext search stopwords which is not doing anything when you search for the word hello http://dev.mysql.com/doc/refman/5.6/en/fulltext-stopwords.html You can setup your own file as In the mysql config file , for debian /etc/mysql/my.cnf add ft_stopword_file='path/to/stopword_file.txt' We can leave this file...

Elasticsearch advanced search

ruby-on-rails,ruby,search

I will prefer to do this in your action. tags = params[:q].present? ? params[:q].scan(/#[^ #]+/).collect{|tag| tag.gsub(/#/, '')} : [] now you can use this array of tags in search function...

How to use all the cores of Solr in solrj

java,indexing,solr,lucene,solrj

here in your code it still points to core1. HttpSolrClient solrClient = new HttpSolrClient("http://localhost:8983/solr/core1" In case you want to have the indexex for core2 you need to change here HttpSolrClient solrClient = new HttpSolrClient("http://localhost:8983/solr/core2" after this change try run the job, it will index for the core2....

CoreSpotlight indexing not working

ios,swift,search,ios9,corespotlight

Try use itemContentType initializer like so : let atset:CSSearchableItemAttributeSet = CSSearchableItemAttributeSet(itemContentType: kUTTypeImage as String) atset.title = "Simple title" atset.contentDescription = "Simple twitter search" let item = CSSearchableItem(uniqueIdentifier: "id1", domainIdentifier: "com.shrikar.twitter.search", attributeSet: atset) CSSearchableIndex.defaultSearchableIndex().indexSearchableItems([item]) { (error) -> Void in print("Indexed") } The kUTTypeImage is declared in MobileCoreServices....

PHP/mySQL results not being displayed [duplicate]

php,mysql,search,result

Firstly don't use the mysql API it is deprecated use PDO or mysqli. Secondly Check $result before passing it to mysql_fetch_array. You'll find that it's false because the query failed. See the mysql_query documentation for possible return values and suggestions for how to deal with them. <?php if (isset($_POST['submit'])) {...

KQL - Ignoring items with property not equal to value

search,sharepoint-2013

So I think I figured it out. I'd have to white two queries combined like this: (ContentTypeId: 'ContentType that has ModerationStatus' ModerationStatus <> 1) OR (ContentTypeId <> 'ContentType that has ModerationStatus') I apologize for the dumb question....

trying to extract a string from a js this keyword

javascript,search,this

When you are in the event handler this points to the clicked link. There is no search method for an element. Probably you are trying to search for a string somewhere in the link, maybe the content. $('body').on("click", 'a', function (evt) { evt.preventDefault(); console.log(this); $('.content').addClass('hide'); if (this.innerHTML.search("AV") > 0) {...

Fuzzy search not working with dismax query parser

solr,lucene

DisMax, by design, does not support all lucene query syntax in it's query parameter. From the documentation: This query parser supports an extremely simplified subset of the Lucene QueryParser syntax. Quotes can be used to group phrases, and +/- can be used to denote mandatory and optional clauses ... but...

Search barre php+mysql “Page not found”

php,mysql,search,prepared-statement

Seems like in <td><input name="name" type="text" /></td> name isn't a appropriate variable name.... When i'm changing to nam it works. I'm sorry for writing an other useless question... But it's like each time the same... I'm stuck for hours trying to correct my stuff, I surrender and ask here. And...

How do I make a query search in rails case insensitive?

ruby-on-rails,postgresql,ruby-on-rails-4,search

Because you are using postgresql: def self.search(query) where("description ilike ?", "%#{query}%") end Just use ilike instead of like. like/ilike documentation If you want to use =, both sides either UPPER or LOWER...

Search code in C# .NET MVC is not working

c#,asp.net-mvc,search

Why don't you try filtering for the object immediately? Also, I'm not sure why you have a second set of curly braces. If the MedsEntities function is a DataContext type, I believe when you are passing lolo to the View, it is still a Queryable. Maybe try this: public ActionResult...

How can I sort by realtime score in solr?

solr

The key for this are function queries. Assumed you use EDisMaxQP, you can specify a boost function (bf) with this value: sub(product(answer_count,100),product(div(ms(NOW,created_at),3600000),5)) However, a function query would influence scoring, but it rather looks like you don’t want any scoring at all and instead a fixed sort order, so I guess...