<?xml version="1.0" encoding="UTF-8"?>
<ticket>
  <assigned-user-id type="integer">22033</assigned-user-id>
  <attachments-count type="integer">0</attachments-count>
  <closed type="boolean">true</closed>
  <created-at type="datetime">2009-04-21T03:55:36-04:00</created-at>
  <creator-id type="integer">54704</creator-id>
  <milestone-due-on type="datetime" nil="true"></milestone-due-on>
  <milestone-id type="integer" nil="true"></milestone-id>
  <number type="integer">83</number>
  <permalink>not_group-support</permalink>
  <priority type="integer">36996</priority>
  <project-id type="integer">16601</project-id>
  <raw-data type="binary" nil="true" encoding="base64"></raw-data>
  <state>moved_to_github</state>
  <tag>conditions group grouping</tag>
  <title>not_group support</title>
  <updated-at type="datetime">2009-08-07T18:30:04-04:00</updated-at>
  <user-id type="integer">22033</user-id>
  <user-name>Ben Johnson</user-name>
  <creator-name>sdecastelberg</creator-name>
  <assigned-user-name>Ben Johnson</assigned-user-name>
  <url>http://binarylogic.lighthouseapp.com/projects/16601/tickets/83</url>
  <original-body>hey,

is something like a 'not_group' available within searchlogic (or in combination with ActiveRecord)?

e.g.:
s=System.new_search
=&gt; #&lt;SystemSearch {:limit=&gt;25}&gt;
&gt;&gt; g=s.conditions.not_group
=&gt; #&lt;SystemConditions&gt;
&gt;&gt; g.name_equals=&quot;test&quot;
=&gt; &quot;test&quot;
&gt;&gt; g.descr_equals=&quot;test&quot;
=&gt; &quot;test&quot;
&gt;&gt; s.count
=&gt; 95

generated sql:
SQL (0.5ms)   SELECT count(&quot;systems&quot;.id) AS count_id FROM &quot;systems&quot; WHERE (NOT ((&quot;systems&quot;.&quot;name&quot; = 'test' AND &quot;systems&quot;.&quot;descr&quot; = 'test')))</original-body>
  <latest-body>hey,

is something like a 'not_group' available within searchlogic (or in combination with ActiveRecord)?

e.g.:
s=System.new_search
=&gt; #&lt;SystemSearch {:limit=&gt;25}&gt;
&gt;&gt; g=s.conditions.not_group
=&gt; #&lt;SystemConditions&gt;
&gt;&gt; g.name_equals=&quot;test&quot;
=&gt; &quot;test&quot;
&gt;&gt; g.descr_equals=&quot;test&quot;
=&gt; &quot;test&quot;
&gt;&gt; s.count
=&gt; 95

generated sql:
SQL (0.5ms)   SELECT count(&quot;systems&quot;.id) AS count_id FROM &quot;systems&quot; WHERE (NOT ((&quot;systems&quot;.&quot;name&quot; = 'test' AND &quot;systems&quot;.&quot;descr&quot; = 'test')))</latest-body>
  <original-body-html>&lt;div&gt;&lt;p&gt;hey,&lt;/p&gt;
&lt;p&gt;is something like a 'not_group' available within searchlogic (or
in combination with ActiveRecord)?&lt;/p&gt;
&lt;p&gt;e.g.: s=System.new_search =&amp;gt; &lt;a href=&quot;/projects/16601/tickets/25&quot; title=&quot;Ticket #25&quot;&gt;#25&lt;/a&gt;}&amp;gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;g=s.conditions.not_group =&amp;gt; # g.name_equals=&quot;test&quot; =&amp;gt;
&quot;test&quot; g.descr_equals=&quot;test&quot; =&amp;gt; &quot;test&quot; s.count =&amp;gt; 95&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;p&gt;generated sql: SQL (0.5ms) SELECT count(&quot;systems&quot;.id) AS
count_id FROM &quot;systems&quot; WHERE (NOT ((&quot;systems&quot;.&quot;name&quot; = 'test' AND
&quot;systems&quot;.&quot;descr&quot; = 'test')))&lt;/p&gt;&lt;/div&gt;</original-body-html>
  <versions type="array">
    <version type="Ticket::Version">
      <assigned-user-id type="integer">22033</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>hey,

is something like a 'not_group' available within searchlogic (or in combination with ActiveRecord)?

e.g.:
s=System.new_search
=&gt; #&lt;SystemSearch {:limit=&gt;25}&gt;
&gt;&gt; g=s.conditions.not_group
=&gt; #&lt;SystemConditions&gt;
&gt;&gt; g.name_equals=&quot;test&quot;
=&gt; &quot;test&quot;
&gt;&gt; g.descr_equals=&quot;test&quot;
=&gt; &quot;test&quot;
&gt;&gt; s.count
=&gt; 95

generated sql:
SQL (0.5ms)   SELECT count(&quot;systems&quot;.id) AS count_id FROM &quot;systems&quot; WHERE (NOT ((&quot;systems&quot;.&quot;name&quot; = 'test' AND &quot;systems&quot;.&quot;descr&quot; = 'test')))</body>
      <body-html>&lt;div&gt;&lt;p&gt;hey,&lt;/p&gt;
&lt;p&gt;is something like a 'not_group' available within searchlogic (or
in combination with ActiveRecord)?&lt;/p&gt;
&lt;p&gt;e.g.: s=System.new_search =&amp;gt; #25}&amp;gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;g=s.conditions.not_group =&amp;gt; #g.name_equals=&quot;test&quot; =&amp;gt;
&quot;test&quot; g.descr_equals=&quot;test&quot; =&amp;gt; &quot;test&quot; s.count =&amp;gt; 95&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;p&gt;generated sql: SQL (0.5ms) SELECT count(&quot;systems&quot;.id) AS
count_id FROM &quot;systems&quot; WHERE (NOT ((&quot;systems&quot;.&quot;name&quot; = 'test' AND
&quot;systems&quot;.&quot;descr&quot; = 'test')))&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-04-21T03:55:36-04:00</created-at>
      <creator-id type="integer">54704</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">83</number>
      <permalink>not_group-support</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">16601</project-id>
      <state>new</state>
      <tag>conditions group grouping</tag>
      <title>not_group support</title>
      <updated-at type="datetime">2009-04-21T03:55:41-04:00</updated-at>
      <user-id type="integer">54704</user-id>
      <user-name>sdecastelberg</user-name>
      <creator-name>sdecastelberg</creator-name>
      <assigned-user-name>Ben Johnson</assigned-user-name>
      <url>http://binarylogic.lighthouseapp.com/projects/16601/tickets/83</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">22033</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>After digging around, trying to find another solution without success I decided to implement that feature within searchlogic. The changes are committed to a fork of searchlogic (http://github.com/sdecastelberg/searchlogic/tree/master). Maybe someone can have a look at it. Feedback is appreciated. (i'm rather new to ruby/ror..)

The implemented not_group works fine for my needs.</body>
      <body-html>&lt;div&gt;&lt;p&gt;After digging around, trying to find another solution without
success I decided to implement that feature within searchlogic. The
changes are committed to a fork of searchlogic (&lt;a href=&quot;http://github.com/sdecastelberg/searchlogic/tree/master)&quot;&gt;http://github.com/sdecastelberg/...&lt;/a&gt;.
Maybe someone can have a look at it. Feedback is appreciated. (i'm
rather new to ruby/ror..)&lt;/p&gt;
&lt;p&gt;The implemented not_group works fine for my needs.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-05-07T04:15:18-04:00</created-at>
      <creator-id type="integer">54704</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">83</number>
      <permalink>not_group-support</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">16601</project-id>
      <state>new</state>
      <tag>conditions group grouping</tag>
      <title>not_group support</title>
      <updated-at type="datetime">2009-05-07T04:15:22-04:00</updated-at>
      <user-id type="integer">54704</user-id>
      <user-name>sdecastelberg</user-name>
      <creator-name>sdecastelberg</creator-name>
      <assigned-user-name>Ben Johnson</assigned-user-name>
      <url>http://binarylogic.lighthouseapp.com/projects/16601/tickets/83</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">22033</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Why wouldn't you adjust your conditions to have the opposite effect instead of doing a not_group. Either way, whatever works for you, if you like the not_group solution then I think its fine, but couldn't you accomplish the same thing by adjusting your conditions?</body>
      <body-html>&lt;div&gt;&lt;p&gt;Why wouldn't you adjust your conditions to have the opposite
effect instead of doing a not_group. Either way, whatever works for
you, if you like the not_group solution then I think its fine, but
couldn't you accomplish the same thing by adjusting your
conditions?&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-06-03T04:07:50-04:00</created-at>
      <creator-id type="integer">54704</creator-id>
      <diffable-attributes type="yaml">--- 
:state: new
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">83</number>
      <permalink>not_group-support</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">16601</project-id>
      <state>open</state>
      <tag>conditions group grouping</tag>
      <title>not_group support</title>
      <updated-at type="datetime">2009-06-03T04:07:51-04:00</updated-at>
      <user-id type="integer">22033</user-id>
      <user-name>Ben Johnson</user-name>
      <creator-name>sdecastelberg</creator-name>
      <assigned-user-name>Ben Johnson</assigned-user-name>
      <url>http://binarylogic.lighthouseapp.com/projects/16601/tickets/83</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">22033</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>the not_group was initially needed for a monitoring/inventory application to map network components (software and hardware) and provide configuration for different network and application layer scanners.

For bulk editing, reporting, etc. we needed an exact match search for every single attribute on every model.

Search Dialog
==============
*group1
    *SnmpScan (include)
        *oid=ssCpuIdle
        *alarm-threshold=90
    *System (exclude)
        *Status=Test
        *Modified Date start: 2009-01-01

would match the following search (when searching for systems)

    (system.snmp_scan.oid=ssCpuIdle AND system.snmp_scan.alarm_threshold=90) AND NOT (system.state=Test AND modified_date&gt;=2009-01-01)

The attributes are grouped model-wise and can be combined differently (and, or) and the search can be expanded by adding other groups with subgroups.
The include/exclude flag just sets the not_group attribute on the group, without having to negate all the single attributes.</body>
      <body-html>&lt;div&gt;&lt;p&gt;the not_group was initially needed for a monitoring/inventory
application to map network components (software and hardware) and
provide configuration for different network and application layer
scanners.&lt;/p&gt;
&lt;p&gt;For bulk editing, reporting, etc. we needed an exact match
search for every single attribute on every model.&lt;/p&gt;
&lt;h1&gt;Search Dialog&lt;/h1&gt;
&lt;p&gt;*group1&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;*SnmpScan (include)
    *oid=ssCpuIdle
    *alarm-threshold=90
*System (exclude)
    *Status=Test
    *Modified Date start: 2009-01-01&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;would match the following search (when searching for
systems)&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;(system.snmp_scan.oid=ssCpuIdle AND system.snmp_scan.alarm_threshold=90) AND NOT (system.state=Test AND modified_date&amp;gt;=2009-01-01)&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;The attributes are grouped model-wise and can be combined
differently (and, or) and the search can be expanded by adding
other groups with subgroups.&lt;br&gt;
The include/exclude flag just sets the not_group attribute on the
group, without having to negate all the single attributes.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-06-03T17:58:15-04:00</created-at>
      <creator-id type="integer">54704</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">83</number>
      <permalink>not_group-support</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">16601</project-id>
      <state>open</state>
      <tag>conditions group grouping</tag>
      <title>not_group support</title>
      <updated-at type="datetime">2009-06-03T17:58:17-04:00</updated-at>
      <user-id type="integer">54704</user-id>
      <user-name>sdecastelberg</user-name>
      <creator-name>sdecastelberg</creator-name>
      <assigned-user-name>Ben Johnson</assigned-user-name>
      <url>http://binarylogic.lighthouseapp.com/projects/16601/tickets/83</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">22033</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>I see what you're saying. But searchlogic deals with single conditions. If you are writing your own named scope for these conditions why not add in the &quot;NOT&quot; yourself? I guess I'm a little confused how you are using searchlogic and how you want to use it.</body>
      <body-html>&lt;div&gt;&lt;p&gt;I see what you're saying. But searchlogic deals with single
conditions. If you are writing your own named scope for these
conditions why not add in the &quot;NOT&quot; yourself? I guess I'm a little
confused how you are using searchlogic and how you want to use
it.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-07-30T02:54:15-04:00</created-at>
      <creator-id type="integer">54704</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">83</number>
      <permalink>not_group-support</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">16601</project-id>
      <state>open</state>
      <tag>conditions group grouping</tag>
      <title>not_group support</title>
      <updated-at type="datetime">2009-07-30T02:54:16-04:00</updated-at>
      <user-id type="integer">22033</user-id>
      <user-name>Ben Johnson</user-name>
      <creator-name>sdecastelberg</creator-name>
      <assigned-user-name>Ben Johnson</assigned-user-name>
      <url>http://binarylogic.lighthouseapp.com/projects/16601/tickets/83</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">22033</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>[state:&quot;moved_to_github&quot; bulk edit command]</body>
      <body-html>&lt;div&gt;&lt;p&gt;[state:&quot;moved_to_github&quot; bulk edit command]&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2009-08-07T18:30:04-04:00</created-at>
      <creator-id type="integer">54704</creator-id>
      <diffable-attributes type="yaml">--- 
:state: open
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">83</number>
      <permalink>not_group-support</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">16601</project-id>
      <state>moved_to_github</state>
      <tag>conditions group grouping</tag>
      <title>not_group support</title>
      <updated-at type="datetime">2009-08-07T18:30:04-04:00</updated-at>
      <user-id type="integer">22033</user-id>
      <user-name>Ben Johnson</user-name>
      <creator-name>sdecastelberg</creator-name>
      <assigned-user-name>Ben Johnson</assigned-user-name>
      <url>http://binarylogic.lighthouseapp.com/projects/16601/tickets/83</url>
    </version>
  </versions>
</ticket>
