search

Rails: Searching multiple tables from one query

只谈情不闲聊 提交于 2020-01-01 07:05:34
问题 How do I write condition statement in find or paginate method to allow users search in Project and Project Category names simultaneously? Now my code looks like this @projects = Project.paginate :per_page => 20, :page => params[:page], :conditions => ['name LIKE ?', "%#{params[:search]}%"] So I have also Category table with name field. How do I combine those two name s together in this search query? 回答1: Assuming that your Project model has_many :categories : @projects = Project.paginate :per

How to position the Placeholder and Search Icon at the center of Search input in jQuery mobile 1.4.0?

拈花ヽ惹草 提交于 2020-01-01 06:53:08
问题 In my jQuery mobile app , I need to position the search Icon and Place holder of a search input field at the center , I have tried the folowing code but it didnt work , the placeholder and the icon are still appearing at the left on android devices . Please help me How can I Position the SearchIcon and Placeholder at the center of the Search input field ? <input type="search" id="SearchFilter" placeholder="Search.." /> <ul data-role="listview" data-filter="true" data-input="#SearchFilter"

AST-based search for Eclipse

你说的曾经没有我的故事 提交于 2020-01-01 05:37:09
问题 Is there a plug-in for Eclipse that lets you search based on the Java AST (Abstract Syntax Tree) of your project files? The "Java Search" feature doesn't seem to cover cases like: "Get me all the fields declared as type 'X' in all classes" I can imagine many more possibilities that would open up with an AST-based search, but I don't even know if such a plug-in would have practical performance. Update : As pointed out by Kevin below, the Java Search feature does cover the use case I mentioned.

Datatables - how to pass search parameter in a url

邮差的信 提交于 2020-01-01 05:33:07
问题 I would like to be able to make a link to a page with a datatable which would pass a search parameter value in the url. The goal is to have the page with the datatable open pre-filtered with the search value parameter. I've set up a jsfiddle to work in with some sample data. http://jsfiddle.net/lbriquet/9CxYT/10/ The idea would be to add a parameter to the jsfiddle url so that the page would display with the search input value set to "firefox", for example, and the table filtered to show only

Lucene indexing and searching at the same time

六月ゝ 毕业季﹏ 提交于 2020-01-01 05:29:22
问题 I want to search with Lucene on an index. The index is changed frequently. So I need to do something to search and index at the same time. It's a web application on Tomcat. And I want to use RAMDeirectory to increase the searching speed. I don't know how to do it! 回答1: NRTManager in the misc Lucene package provides the ability to search and index at the same time. TrackingIndexWriter writer; // your writer SearcherFactory factory = new SearcherFactory(); NRTManager mgr = new NRTManager(writer

Searching in Xcode not finding results (searching my source)

人盡茶涼 提交于 2020-01-01 03:56:07
问题 I'm pulling my hair out on this and Google results are skewed since it thinks I want to find out how to code something. My problem is that when trying to search my code with the String Matching box it finds nothing, even if I enter something that is on the screen below. Is it Spotlight that is delivering these results? I'm not excluding anything in my Spotlight index so should I just rebuild the index? 回答1: At the top of the Xcode search field, you probably want to select: Find > Text >

Is there a way to include stopwords when searching exact phrases in Solr?

五迷三道 提交于 2020-01-01 02:30:30
问题 I want stopwords excluded except when the search term is within double quotes eg. "just like that" should also search "that". Is this possible? 回答1: It depends on the configuration of the field you are querying. If the configuration of the indexing analyzer includes a StopFilterFactory, then the stopwords are simply not indexed, so you can not query for them afterward. But since Solr keeps the position of the terms in the index, you can instruct it to increment the position value of the

Whats the easiest site search application to implement, that supports fuzzy searching?

扶醉桌前 提交于 2020-01-01 01:12:33
问题 I have a site that needs to search thru about 20-30k records, which are mostly movie and TV show names. The site runs php/mysql with memcache. Im looking to replace the FULLTEXT with soundex() searching that I currently have, which works... kind of, but isn't very good in many situations. Are there any decent search scripts out there that are simple to implement, and will provide a decent searching capability (of 3 columns in a table). 回答1: ewemli's answer is in the right direction but you

Is it possible to create a public database (spreadsheet) search with Google Scripts?

懵懂的女人 提交于 2020-01-01 00:48:14
问题 I'm trying to create a website where users can come and look for a set of resources, something like a portal, or a database like JSTOR. I am using Weebly; this website will eventually be turned over to someone who does not know computers well, so I'm trying to keep things simple (and free, where doable) . My thought was to use Google Spreadsheets/Forms to handle the input and storage of the data for each individual resources (Title, Author, Type, Topic, Country, etc.) , and then find some

How to search for text fragments in a database

十年热恋 提交于 2019-12-31 22:41:09
问题 Are there any open source or commercial tools available that allow for text fragment indexing of database contents and can be queried from Java? Background of the question is a large MySQL database table with several hundred thousand records, containing several VARCHAR columns. In these columns people would like to search for fragments of the contents, so a fulltext index (which is based on word boundaries) would not help. EDIT : [Added to make clear why these first suggestions would not