search

linux find prune

你离开我真会死。 提交于 2019-12-24 13:34:00
问题 I am trying to exclude two directories; vntvdone and downloading, but for some reason, my command still goes in there and outputs the file within it: find -name '*.avi' -o -name '*.mkv' -o -name '*.mp4' -o -name '*.VOB' -o -path './downloading' -prune -o -path './vntvdone' -prune I am also running into problems where if a folder/directory that has .mp4 in it, it also gets treated as a file as well... how can we do this search only for files and not folders? 回答1: I find it easier to use ! than

Alternative for IMAP search command

被刻印的时光 ゝ 提交于 2019-12-24 13:26:36
问题 I need an alternative for IMAP search command " A search 1:* unseen not deleted " since the email server is forbidding the search command. I tried using " A status (unseen) " but it always returns zero though there's an unread message. Is there any alternative for the command? Thanks in advance. 回答1: Is your problem that the IMAP server doesn't support SEARCH at all, or that it doesn't like your particular SEARCH command? If it's the latter, we can simplify: A SEARCH UNSEEN UNDELETED (as 1:*

Pure PHP based boolean search for strings

余生颓废 提交于 2019-12-24 13:25:54
问题 I have a project where I need some basic boolean search in pure PHP. It means I have plain strings I want to offer some simple boolean search on them. No database or other indexing engine is involved, so please don't refer to MySQL boolean search or lucene. At the end something like the following code should print contains and not found . $search = 'foo -bar "must have" -"must not have"'; $contentFound = 'This is some foo text you must have.'; $contentNotFound = 'This is some bar text you

how to ignore case-sensitiveness and include nested documents when searching on Rails 4 with Mongoid

别说谁变了你拦得住时间么 提交于 2019-12-24 13:25:36
问题 parent.rb class Parent include Mongoid::Document field :name, type: String field :hobby, type: String field :born, type: Date has_many :children accepts_nested_attributes_for :children def self.search(search) if search any_of({name: search}, {hobby: search}) end end end child.rb: class Child include Mongoid::Document field :name, type: String field :hobby, type: String field :born, type: Date belongs_to :parent end parents_controller.rb class ParentsController < ApplicationController before

Hibernate Search + DbUnit Indexing

大城市里の小女人 提交于 2019-12-24 13:09:16
问题 I am writing some JUnits for my hibernate search implementation. I use a HSSQL in memory database. I use DBUnit to populate this DB (an XML file). It definitely works as other non-search tests work with the same data. The search code definitely works as I've tried it in the web-app and it returns the correct records. I assume that Hibernate Search will only index database entries that have been inserted using Hibernate. I tried to index the db manually using : - fullTextEntityManager

Search page on the django

拜拜、爱过 提交于 2019-12-24 13:00:25
问题 I want to an easy way to create search page on my site to searching only the titles. What is the easiest way for to do that? I am the new to django and I dont know how to do this better, I've read manuals but is confusing. This is my code so far: import re from django.db.models import Q def normalize_query(query_string, findterms=re.compile(r'"([^"]+)"|(\S+)').findall, normspace=re.compile(r'\s{2,}').sub): ''' Splits the query string in invidual keywords, getting rid of unecessary spaces and

How can I search CSS with Perl?

可紊 提交于 2019-12-24 12:53:53
问题 First question from a long time user. I'm writing a Perl script that will go through a number of HTML files, search them line-by-line for instances of "color:" or "background-color:" (the CSS tags) and print the entire line when it comes across one of these instances. This is fairly straightforward. Now I'll admit I'm still a beginning programmer, so this next part may be extremely obvious, but that's why I came here :). What I want it to do is when it finds an instance of "color:" or

Solr search with Mysql Database, any utility for data importing

核能气质少年 提交于 2019-12-24 12:39:29
问题 We are looking at ways of improving "search" functionality in our large business application which currently uses SQL Like syntax to do it. So we started evaluating Solr server and were able to index few of our database tables and search. But I am newbie and wanted to know if 1) We have large number of tables in our application. Is there any utility that generates schema xml in solr using the database tables? 2) Our current search lists the database row that meets the search criteria (this

Fulltext search vs standard database search

佐手、 提交于 2019-12-24 12:28:23
问题 What I want to know what is difference between fulltext searching (searching data in files) and standard database searching (LIKE, IN ect). What I notice here is that in files you don't have data types, but in database you can define data types for particular data. I am interested in what kind of search is faster and what are advantages and disadvantages of both. Thanks. 回答1: There's a few advantages to full text searching. Indexing: Something like: WHERE Foo LIKE '%Bar'; Cannot take

Search in firebase database for android?

亡梦爱人 提交于 2019-12-24 12:27:34
问题 project name > users > user1key > name , latitude , longitude user2key > name , latitude , longitude This is the tree in database. I want a query to search the user using its name. and get its details. 回答1: Something like this should do the trick: DatabaseReference ref = FirebaseDatabase.getInstance().getReference("users"); ref.orderByChild("name").equalTo("Yash Mehta").addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) {