Git Product home page Git Product logo

Comments (8)

mrkamel avatar mrkamel commented on June 5, 2024

please provide more details ...

Server.search("ip:'8.8.8.8'")

from search_cop.

eddiefisher avatar eddiefisher commented on June 5, 2024
irb(main):021:0> HostSearch.search(ip: '192')
NameError: uninitialized constant SearchCopGrammar::Attributes::Inet
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/search_cop-1.0.6/lib/search_cop_grammar/attributes.rb:89:in `const_get'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/search_cop-1.0.6/lib/search_cop_grammar/attributes.rb:89:in `attribute_for'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/search_cop-1.0.6/lib/search_cop_grammar/attributes.rb:55:in `block in attributes'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/search_cop-1.0.6/lib/search_cop_grammar/attributes.rb:55:in `collect'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/search_cop-1.0.6/lib/search_cop_grammar/attributes.rb:55:in `attributes'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/search_cop-1.0.6/lib/search_cop_grammar/attributes.rb:38:in `matches'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/search_cop-1.0.6/lib/search_cop/hash_parser.rb:38:in `parse_attribute'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/search_cop-1.0.6/lib/search_cop/hash_parser.rb:21:in `block in parse'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/search_cop-1.0.6/lib/search_cop/hash_parser.rb:10:in `each'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/search_cop-1.0.6/lib/search_cop/hash_parser.rb:10:in `collect'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/search_cop-1.0.6/lib/search_cop/hash_parser.rb:10:in `parse'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/search_cop-1.0.6/lib/search_cop.rb:23:in `parse'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/search_cop-1.0.6/lib/search_cop/query_builder.rb:10:in `initialize'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/search_cop-1.0.6/lib/search_cop.rb:61:in `new'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/search_cop-1.0.6/lib/search_cop.rb:61:in `unsafe_search_cop'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/search_cop-1.0.6/lib/search_cop.rb:53:in `search_cop'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/search_cop-1.0.6/lib/search_cop.rb:44:in `block in search_scope'
  from (irb):21
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands/console.rb:110:in `start'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands/console.rb:9:in `start'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:68:in `console'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
  from /Users/user/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
  from bin/rails:4:in `require'

from search_cop.

eddiefisher avatar eddiefisher commented on June 5, 2024

db: posgresql

from search_cop.

mrkamel avatar mrkamel commented on June 5, 2024

huh, could you please provide your search_cop specification from your model ...

from search_cop.

eddiefisher avatar eddiefisher commented on June 5, 2024
class HostSearch < ::Host
  include SearchCop

  search_scope :search do
    attributes :ip, :name
  end
end

from search_cop.

eddiefisher avatar eddiefisher commented on June 5, 2024

schema

  create_table "hosts", force: :cascade do |t|
    t.inet     "ip",                                         null: false
    t.string   "name",                  limit: 255
  end

from search_cop.

mrkamel avatar mrkamel commented on June 5, 2024

ah, ok, postgres specific datatype. search_cop currently supports text, numeric, date and boolean datatypes. I'll check if this should be extended, thx.

from search_cop.

eddiefisher avatar eddiefisher commented on June 5, 2024

thx

from search_cop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.