search

advance table search in rails

倖福魔咒の 提交于 2019-12-24 08:13:43
问题 In my app i have generated a scaffold called data and had filed the table with name, school, college, views, interest. Now i want to add a search that if someone put NAME in the search bar, they should get all the names only as results, if someone had put college, they should get all the college only. Am pretty new to rails, so i tried watching some tutorials, and had added this but this is not what i want <%= form_tag data_path, :method => 'get' do %> <%= text_field_tag :search, params[

SOLR - Regex in Filter query

不问归期 提交于 2019-12-24 07:41:24
问题 I want to implement Regex in fq but never implemented it before. I have the below value in a property and the fieldtype is "lowercase": Prop=company1@city1@state1@country1@senior analytical chemist, chicago I want to filter the results based on the regex. The regex should match the above if "company1@city1@state1@country1@"+ regex to match chicago and analytical anywhere after last @ symbol. My requirement is to match the exact values before last @ and then use regex to match the remaining

mysql php js live search

空扰寡人 提交于 2019-12-24 07:39:16
问题 I'm currently doing a live search form based on Jquery/ajax/php, but it dosent seems to work. Can you guys se a problem in my code? :) function getStates(value) { $.post("search.php",{ partialState: value }, function(data) { $("#results").html(data); }); } <input type="text" onkeyup="getStates(this.value)" /> <div id="results"></div> Search.php: $partialStates = $_POST['partialState']; $states = mysql_query("SELECT institution_name FROM sb_institutions WHERE institution_name LIKE '%

SQL users searching query

对着背影说爱祢 提交于 2019-12-24 07:32:06
问题 I would like to create query to search given information in table users . Table consists: of id , username , firstname , lastname , phone and email . Sample search text: mat h 50 @l d The only record that should be returned: 1 | admin | mat | hladeo | 123450789 | admin@localhost My query: SELECT * FROM `users` WHERE ( (`firstname` LIKE '%mat%') || (`firstname` LIKE '%h%') || (`firstname` LIKE '%50%') || (`firstname` LIKE '%@l%') || (`firstname` LIKE '%d%') ) && ( (`lastname` LIKE '%mat%') ||

Eclipse - search for resource - limit extension to match .js NOT .jsp

試著忘記壹切 提交于 2019-12-24 07:19:26
问题 In Eclipse, when I press Ctrl+Shift+R to bring up the 'Open resource' dialog window, I can't figure out a way of searching only for javascript files (.js), as any search string I enter will always yield .jsp files as well. I tried abc*.js (explicit file extension does not work, as still JSPs are returned), abc*.?? (trying to limit the length of extension to any TWO characters, still returns JSPs)... it's a bit annoying. Is there any way to get the window to return .js files only? 回答1: Wow, I

Apply column search to current jQuery DataTable

早过忘川 提交于 2019-12-24 07:18:40
问题 I have a current jQuery DataTable in place that is functioning properly: var $dataTable = $('#example1').DataTable({ "ajax": 'api/tableSearch.php', "iDisplayLength": 25, "order": [[ 6, "desc" ]], "scrollY": 600, "scrollX": true, "bDestroy": true, "columnDefs": [{ "targets": 0, "render": function (data, type, full, meta){ return '<a class="editLink" href="#">Edit</a><a class="deleteLink" href="#">Del</a>': } }] }); As stated, the above code works accordingly...the search filter works, the

Search filter continued

心已入冬 提交于 2019-12-24 07:09:25
问题 This is what I have so far. The search_db.php now shows the user field as hyperlinks which is great, when the links are followed I get no search results. search_db.php $term = $_POST['term']; $data = mysql_query("select * FROM mordred13 WHERE alliance like '%$term%' ORDER BY alliance, might DESC"); echo "<table border='1' cellpadding='5'>"; echo "<tr> <th>Alliance</th> <th>User</th> <th>Might</th>"; // loop through results of database query, displaying them in the table while($row = mysql

Finding the shortest path between two points in 2D Array

落爺英雄遲暮 提交于 2019-12-24 06:47:21
问题 I have a simple game, I'm trying to get the shortest route between 2 points The map consists of 2d array matrix: Node[][] , class Node{ index: { x: number, y: number }, isAvailable: boolean } The algorithm should return the shortest path with respect to node availability. e.g. Trees are marked as unavailable node.isAvailable = false I'm stuck on implementing the algorithm for this matrix I tried to use Dijkstras algorithm from here, but I couldn't figure out how to apply it, I did const graph

Search for keywords in Word documents and index them

安稳与你 提交于 2019-12-24 06:35:24
问题 I'm looking for a way to search in Word documents and show a result of documents that matched the search criteria. I'll try to describe the scenario in more detail here. On a Windows system i have a bunch of folders. Each folder has alot of Word documents. Now i need an application that can search inside a specific folder for keywords that might occure in those word documents. Something like the FULLTEXT search that MySQL has. So if i search for the following keywords: microsoft, windows XP

How to tokenize an String like in lexer in java?

心不动则不痛 提交于 2019-12-24 06:31:14
问题 Lines of code which i want to tokenize according to lexer rules. String input1 = input.replaceAll("\\s+"," "); List<String> uncleanList = Arrays.asList(input1.split(" ")); I put this code in String. replaced all multi spaces into one space String s = codeString.replaceAll("\\s+"," "); then String t= s.split(" ") method on that string which gave me an array with the help of single space. i got this Array result(This is console output by System.out.println(Arrays.toString(s)); ): [String,