search

Use existing analyzer in hibernate search AnalyzerDiscriminator

十年热恋 提交于 2019-12-21 18:34:02
问题 @Entity @Indexed @AnalyzerDefs({ @AnalyzerDef(name = "en", tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class), filters = { @TokenFilterDef(factory = LowerCaseFilterFactory.class), @TokenFilterDef(factory = EnglishPorterFilterFactory.class ) }), @AnalyzerDef(name = "de", tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class), filters = { @TokenFilterDef(factory = LowerCaseFilterFactory.class), @TokenFilterDef(factory = GermanStemFilterFactory.class) }) }) public

Google Custom Search imgSize and imgType not taken into account

一曲冷凌霜 提交于 2019-12-21 17:42:06
问题 https://www.googleapis.com/customsearch/v1?key=XXXXX&imgType=photo&imgSize=small&q=%EF%BB%BFShrimp%2C%20Bacon.%20Avocado%20Pasta%20Salad%0D&cx=XXXXXX When I do a custom search, it returns images and a formatted JSON as expected. The only thing that is not expected and that is not taken into account are the parameters: imgType=photo imgSize=small It makes no difference for google, and I am still receiving Clipart images and very large images (in some cases larger than 2500 px). Any ideas? (PS:

php Extract Best guess for this image result from google image search?

北城以北 提交于 2019-12-21 17:31:38
问题 I have a requirement where i have to reverse lookup an image on google and extract the name printed on the "Best guess for this image:" title. No i did some modifications to an existing curl code on the net and came this far: <?php function fetch_google($terms="sample search",$numpages=1,$user_agent='Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20100101 Firefox/8.0') { $searched=""; for($i=0;$i<=$numpages;$i++) { $ch = curl_init(); $url="http://www.google.com/searchbyimage?hl=en&image_url="

Increase speed of MySQL LIKE query?

╄→尐↘猪︶ㄣ 提交于 2019-12-21 17:16:15
问题 For an airport input field with autocompletion, there currently is one table with airport descriptions, autocomplete_airport : lang | description (with INDEX) | ... -----+----------------------------------------------------+---- pt | New York - John F Kennedy (JFK), Estados Unidos | ... pt | Nova Iorque - John F Kennedy (JFK), Estados Unidos | ... ... Autocompletion works on individual words. So when the user enters "yor", then "new york" shows up (if in LIMIT). The query currently works as

Global “search function” in whole app

∥☆過路亽.° 提交于 2019-12-21 16:20:26
问题 In my application throughout I want the search button to perform a separate Activity . i.e. From anywhere in the app when I press the search button I want a separate Activity to get called. Is there any way that instead of defining onSearchRequested() in every activity, I just configure it at one place (like Manifest.xml ) and it can be used throughout the app? 回答1: You could define an (not necessarily) abstract class that extends Activity, implement onSearchRequest there and inherit all

Searching for a string in multiple files on Linux [closed]

只愿长相守 提交于 2019-12-21 14:34:14
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . How to search in multiple files or folders for a string inside a plaintext file? For example I need to find the string "foo" in all files in the folder "/home/thisuser/bar/baz/" 回答1: You need to have read privileges on the files you will be searching in. If you do have them, then simply use grep -r "foo" /home

Searching for a string in multiple files on Linux [closed]

徘徊边缘 提交于 2019-12-21 14:34:13
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . How to search in multiple files or folders for a string inside a plaintext file? For example I need to find the string "foo" in all files in the folder "/home/thisuser/bar/baz/" 回答1: You need to have read privileges on the files you will be searching in. If you do have them, then simply use grep -r "foo" /home

Elasticsearch - EdgeNgram + highlight + term_vector = bad highlights

一曲冷凌霜 提交于 2019-12-21 12:39:55
问题 When i use an analyzer with edgengram (min=3, max=7, front) + term_vector=with_positions_offsets With document having text = "CouchDB" When i search for "couc" My highlight is on "cou" and not "couc" It seems my highlight is only on the minimum matching token "cou" while i would expect to be on the exact token (if possible) or at least the longest token found. It works fine without analyzing the text with term_vector=with_positions_offsets What's the impact of removing the term_vector=with

Using Python to ask a web page to run a search

孤街浪徒 提交于 2019-12-21 12:31:12
问题 I have a list of protein names in the "Uniprot" format, and I'd like to convert them all to the MGI format. If you go to www.uniprot.org and type the uniprot protein name into the "Query" bar, it will generate a page with a bunch of information about that protein, including its MGI name (albeit much further down the page). For example, one Uniprot name is "Q9D880", and by scrolling down, you can see that its corresponding MGI name is "1913775". I already know how to use Python's urllib to

Sentence aware search with Lucene SpanQueries

青春壹個敷衍的年華 提交于 2019-12-21 12:29:19
问题 Is it possible to use a Lucene SpanQuery to find all occurrences where the terms "red" "green" and "blue" all appear within a single sentence? My first (incomplete/incorrect) approach is to write an analyzer that places a special sentence marker token and the beginning of a sentence in the same position as the first word of the sentence and to then query for something similar to the following: SpanQuery termsInSentence = new SpanNearQuery( SpanQuery[] { new SpanTermQuery( new Term (MY_SPECIAL