<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,7 @@
+* support punctuation in wildcard matching
+
+* fixing nested search calls
+
 * chain a separate search with &quot;or_search&quot; to find records matching either one
   
   search(&quot;foo&quot;).or_search(:conditions =&gt; { :priority =&gt; 3 })</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -165,10 +165,10 @@ module Xapit
     # Expands the wildcard in the term (just at the end) and returns a query
     # which will match any term that starts with the given term.
     def wildcard_query(term, prefix = &quot;&quot;)
-      partial_term = term.sub(/\*$/, '') # remove asterisk at end if it exists
+      full_term = (prefix + term.downcase).sub(/\*$/, '') # remove asterisk at end if it exists
       parser = Xapian::QueryParser.new
       parser.database = Xapit::Config.database
-      parser.parse_query(partial_term, Xapian::QueryParser::FLAG_PARTIAL, prefix)
+      parser.parse_query(full_term[-1..-1], Xapian::QueryParser::FLAG_PARTIAL, full_term[0..-2])
     end
   end
 end</diff>
      <filename>lib/xapit/query_parsers/abstract_query_parser.rb</filename>
    </modified>
    <modified>
      <diff>@@ -48,4 +48,13 @@ describe Xapit::AbstractQueryParser do
     parser = Xapit::AbstractQueryParser.new(XapitMember, :conditions =&gt; { :foo =&gt; [2..5, 10] })
     parser.condition_terms.first.xapian_query.description.should == expected.description
   end
+    
+  it &quot;should expand punctuated terms properly&quot; do
+    XapitMember.xapit { |i| i.field :name }
+    bar = XapitMember.new(:name =&gt; &quot;foo-bar&quot;)
+    baz = XapitMember.new(:name =&gt; &quot;foo-baz&quot;)
+    zap = XapitMember.new(:name =&gt; &quot;foo-zap&quot;)
+    Xapit.index_all
+    XapitMember.search(:conditions =&gt; { :name =&gt; &quot;foo-b*&quot;}).should == [bar, baz]
+  end
 end</diff>
      <filename>spec/xapit/query_parsers/abstract_query_parser_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8bddfed3981c95d44b9bbf4582bf28c5869cadb6</id>
    </parent>
  </parents>
  <author>
    <name>Ryan Bates</name>
    <email>ryan@railscasts.com</email>
  </author>
  <url>http://github.com/ryanb/xapit/commit/381633d6430b0c1a04cd7cfebba6911e05732159</url>
  <id>381633d6430b0c1a04cd7cfebba6911e05732159</id>
  <committed-date>2009-07-07T16:15:03-07:00</committed-date>
  <authored-date>2009-07-07T16:15:03-07:00</authored-date>
  <message>adding support for punctuation in wildcard matching</message>
  <tree>519f7cda5a1e56ded6f3f0fe18a2447eb5772c96</tree>
  <committer>
    <name>Ryan Bates</name>
    <email>ryan@railscasts.com</email>
  </committer>
</commit>
