为什么可以';我不能在shopify中搜索空间我该怎么做?

为什么可以';我不能在shopify中搜索空间我该怎么做?,shopify,liquid,Shopify,Liquid,更新 好的,我知道问题是什么,但不知道如何解决。 供应商:牛角或标题:牛角不起作用 标题:牛角或供应商:牛角有。 空格导致附加前缀中断,因为“或”在我的搜索结果中不能正常工作。 供应商:cow或标题:cow作品 但当我在搜索中放置空格时,标题就不会被搜索 我有一个搜索栏,我将其设置为搜索项目标签、供应商和标题。 问题是这段代码阻止我在搜索词中使用空格,如果我加上“*”我就不能使用符号。这是密码 <form method="get" action="/search" id="search-

更新

好的,我知道问题是什么,但不知道如何解决。
供应商:牛角或标题:牛角不起作用 标题:牛角或供应商:牛角有。

空格导致附加前缀中断,因为“或”在我的搜索结果中不能正常工作。
供应商:cow或标题:cow作品
但当我在搜索中放置空格时,标题就不会被搜索


我有一个搜索栏,我将其设置为搜索项目标签、供应商和标题。
问题是这段代码阻止我在搜索词中使用空格,如果我加上“*”我就不能使用符号。这是密码

<form method="get" action="/search" id="search-home">
   <button type="submit" value="search"></button>
   <input type="hidden" name="type" value="product" />
   <input type="hidden" name="q" class="searchtext" />
   <input type="text" name="original" placeholder="Search"/>
</form>

<script>
$(document).on('submit','#search-home',function(){
var searchtext = $('input[name="original"]').val();
$('.searchtext').val("vendor:"+searchtext+" OR tag:"+searchtext+" OR title:"+searchtext);
});
</script>

$(文档).on('submit','#search home',函数(){
var searchtext=$('input[name=“original”]).val();
$('.searchtext').val(“供应商:+searchtext+”或标记:+searchtext+”或标题:+searchtext”);
});
如果你需要查看search.liquid,在这里

<div id="impact-grid-header" class="collections-page">
   <h1 id="regular-title">Search Results for: "{{ search.terms[1] | replace: 'vendor:', ''  | replace: 'tag:', '' | replace: 'title:', '' | replace: '*', '' | strip  | escape}}"</h1>
</div>
<div id="product-content" class="full-bleed">
<div class="content">
   {% paginate search.results by 20 %}
   <!-- Begin collection info -->
   <div class="row">
      <!-- End sort collection -->
      <div class="column inventory-items">
         {% include 'search-bar' %}
         <div id="inventory" class="span12 content-grid">
            <!-- Begin no products -->
            {% if search.results.size == 0 %}
            <div class="row">
               <div class="span12 expanded-message">
                  <p>That's a great idea but unfortunately we don't have that item.<br/>Try again?</p>
               </div>
            </div>
            {% endif %}
            <div class="row products">
               {% for item in search.results limit: settings.pagination_limit %}
               {% if item.variants.first.inventory_quantity >= 0 %}
               <div class="item product" data-tags="{% for tag in item.tags %}{{ tag | downcase }}, {% endfor %}">
                  <a href="{{ item.url }}">
                     <div class="product-pic">
                        <div class="inner-pic">
                           <img src="{{ item.featured_image | product_img_url: 'large' }}" alt="{{ item.title | escape  }}"/>
                        </div>
                        <!-- Box that appears upon hover -->
                        <div class="view-product bg-black">
                           <i class="icon-search"></i>
                           <span>View</span>
                        </div>
                     </div>
                  </a>
                  <div class="description">
                     <a href="{{ item.url }}"><span class="product-name">{{ item.title }}</span></a>
                     <span class="brand">{{ item.vendor }}</span>
                     <span class="price">
                     {% if item.available %}
                     {% if item.compare_at_price_max > item.price %}
                     <del>{{ item.compare_at_price | money }}</del>
                     {% endif %}
                     {% if item.price_varies %}
                     <em>from</em>
                     {% endif %}
                     <span>{{ item.price | money }}</span>
                     {% else %}
                     <span>
                     {{ item.price | money }} Sold Out
                     </span>
                     {% endif %}
                     </span>
                     <span class="shopify-product-reviews-badge" data-id="{{ product.id }}"></span>
                  </div>
               </div>
               {% endif %}
               {% endfor %}
            </div>
            {% include 'pagination' %}
            {% endpaginate %}
            <!-- End no products -->
         </div>
      </div>
   </div>
</div>

搜索结果为:“{Search.terms[1]| replace:'供应商:',''| replace:'标签:',''|replace:'标题:',''|replace:'*',''|带|转义}”
{%paginate search.results按20%分页}
{%include'搜索栏“%”
{%if search.results.size==0%}
这是个好主意,但不幸的是我们没有该商品。
再试一次

{%endif%} {search.results limit:settings.pagination_limit%} {%if item.variants.first.inventory\u数量>=0%} {{item.vendor}} {%if item.available%} {%if item.compare_at_price_max>item.price%} {{item.compare_at_price|money} {%endif%} {如果item.price_变化%} 从…起 {%endif%} {{item.price | money}} {%else%} {{item.price | money}}售罄 {%endif%} {%endif%} {%endfor%} {%include'分页“} {%endpaginate%}