eddie https://www.e-learn.cn/tag/eddie zh-hans 第三章 最小化SpringXml 配置 https://www.e-learn.cn/topic/3389658 <span>第三章 最小化SpringXml 配置</span> <span><span lang="" about="/user/141" typeof="schema:Person" property="schema:name" datatype="">左心房为你撑大大i</span></span> <span>2020-02-13 07:37:37</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"> <p>自动装配(autowiring):有助于减少甚至消除&lt;property&gt;元素和&lt;constructor-arg&gt;元素,让spring自动识别如何装配Bean的依赖关系。</p> <p>自动检测(autodiscovery):比自动装配更进一步,让spring能够自动识别哪些类需要被装配成sping Bean ,从而减少对&lt;bean&gt;元素的使用。</p> <h2>3.1 自动装配Bean属性</h2> <h3>3.1.1 4种类型的自动装配</h3> <p>  byName——把与Bean的属性具有相同的名字(或者ID)的其他Bean自动装配到Bean对应的属性中。如果没有跟属性的名字像匹配的Bean,则该属性不进行装配。</p> <p>  byType——把与Bean的属性具有相同类型的其他Bean自动装配到Bean的对应属性中,若果没有跟属性的类型相匹配的bean,则该属性不被装配。</p> <p>  constructor——把与Bean的构造器入参具有相同类型的其他Bean自动装配到Bean构造器的对应参数中。</p> <p>  autodetect——首先尝试使用constructor进行自动装配,如果失败,再尝试使用byType进行自动装配。</p> <p>  byName自动装配:</p> <img id="code_img_closed_7af1a61d-f9d6-477c-9c2c-86a63db9c6d1" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_7af1a61d-f9d6-477c-9c2c-86a63db9c6d1" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('7af1a61d-f9d6-477c-9c2c-86a63db9c6d1',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_7af1a61d-f9d6-477c-9c2c-86a63db9c6d1" class="cnblogs_code_hide"> <pre> 1 &lt;!-- byName自动装配 2 缺点:若是有多个音乐家需要装配instrument属性,则他们就会公用一个Saxopbone(即多个bean的属性被同一个bean赋值) 3 --&gt; 4 &lt;!-- 先在容器中装个乐器对象 --&gt; 5 &lt;bean id="instrument" class="com.springinaction.springidol.Saxophone"&gt;&lt;/bean&gt; 6 &lt;!--现在为音乐家kenny自动装配上面instrument的乐器--&gt; 7 &lt;bean id="kenny" --&gt; 8 class="com.springinaction.springidol.Instrumentalist" 9 autowire="byName"&gt; 10 &lt;property name="song" value="演员——薛之谦"&gt;&lt;/property&gt; 11 &lt;/bean&gt; 12 13 &lt;bean id="kenny1" 14 class="com.springinaction.springidol.Instrumentalist" 15 autowire="byName"&gt; 16 &lt;property name="song" value="演员1——薛之谦"&gt;&lt;/property&gt; 17 &lt;/bean&gt; </pre> </div> <span class="cnblogs_code_collapse">View Code</span> <p>  byType自动装配,容器中若是有同个类型的多个bean,自动装配的时候,会出抛出异常(就像选择性综合征,多了不知选哪个了)NoUniqueBeanDefinitionException(不唯一bean定义异常,翻译的可能不准确):</p> <img id="code_img_closed_6837d569-a33b-4fc7-932b-3ca183083d4c" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_6837d569-a33b-4fc7-932b-3ca183083d4c" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('6837d569-a33b-4fc7-932b-3ca183083d4c',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_6837d569-a33b-4fc7-932b-3ca183083d4c" class="cnblogs_code_hide"> <pre> 1 &lt;!-- byType装配 2 有两个乐器:kenny bean就不知道要识别那个乐器装配给自己, 3 会抛出异常NoUniqueBeanDefinitionException(非唯一bean定义异常-个人翻译,可能不正确), 4 但是下面会出现提示: 5 org.springframework.beans.factory.UnsatisfiedDependencyException: 6 Error creating bean with name 'kenny' defined in class path resource [spring/springbean.xml]: Unsatisfied dependency expressed through bean property 'instrument': No qualifying bean of type [com.springinaction.springidol.Instrument] is defined: expected single matching bean but found 2: com.springinaction.springidol.Saxophone#0,com.springinaction.springidol.Guitar#0; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.springinaction.springidol.Instrument] is defined: expected single matching bean but found 2: com.springinaction.springidol.Saxophone#0,com.springinaction.springidol.Guitar#0 7 Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.springinaction.springidol.Instrument] is defined: expected single matching bean but found 2: com.springinaction.springidol.Saxophone#0,com.springinaction.springidol.Guitar#0 8 --&gt; 9 &lt;!-- Saxophone类型的bean --&gt; 10 &lt;bean class="com.springinaction.springidol.Saxophone"&gt;&lt;/bean&gt; 11 &lt;!--Guitar类型的bean--&gt; 12 &lt;bean class="com.springinaction.springidol.Guitar"&gt;&lt;/bean&gt; 13 14 &lt;bean id="kenny" 15 class="com.springinaction.springidol.Instrumentalist" 16 autowire="byType"&gt; 17 &lt;property name="song" value="演员——薛之谦"&gt;&lt;/property&gt; 18 &lt;/bean&gt; </pre> </div> <span class="cnblogs_code_collapse">View Code</span> <p>  constructor自动装配:</p> <img id="code_img_closed_cfc32d70-f4e6-4bf5-b147-3e7fb44ed6f1" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_cfc32d70-f4e6-4bf5-b147-3e7fb44ed6f1" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('cfc32d70-f4e6-4bf5-b147-3e7fb44ed6f1',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_cfc32d70-f4e6-4bf5-b147-3e7fb44ed6f1" class="cnblogs_code_hide"> <pre>1 &lt;!-- constructor 自动装配 2 这个要求PoeticJuggler类中有一个构造器的参数是Sonnet29(他是--实现Poem的实现类)类型的 3 --&gt; 4 &lt;bean class="com.springinaction.springidol.Sonnet29"&gt;&lt;/bean&gt; 5 6 &lt;bean id="duke" 7 class="com.springinaction.springidol.PoeticJuggler" 8 autowire="constructor"/&gt;</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <p>   autodetect混合装配,就不介绍了。</p> <p>  注:在测试代码的时候,遇到了如下的SAXParseException异常:<br />Caused by: org.xml.sax.SAXParseException; lineNumber: 48; columnNumber: 45; 注释中不允许出现字符串 "--"。<br />    at ;<br />  这个是由于springbean.xml中的注释&lt;!-- 这里是注释 --&gt;除了开头和结尾可以有"--"外,里面不能有第三个"--",不如:&lt;!-- 这里是是--注释 --&gt;就会报上面的错误,这个一看就明白了。</p> <h3>3.1.2 默认自动装配</h3> <p>  若果需要为Spring应用上下文中的额每一个Bean(或者其中大多数)配置相同的autowire属性,那么可以要求spring为它所创建的所有Bean引用相同的自动装配策略来简化配置</p> <p><img alt="" class="b-lazy" data-src="https://images2015.cnblogs.com/blog/992219/201703/992219-20170321153040065-810230740.png" data-original="https://images2015.cnblogs.com/blog/992219/201703/992219-20170321153040065-810230740.png" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /></p> <h2>3.2 使用注解装配</h2> <p>  使用注解方式允许更细粒度的自动装配,我们可以选择性标注某一个属性来对其应用自动装配。spring容器默认禁用注解装配,所以,在使用基于注解的自动装配,我们需要在spring配置中启用它。最简单的启用方式是使用spring的context命名空间配置中的&lt;context:annotation-config&gt;元素:</p> <p>  spring的context命名空间: xmlns:context="http://www.springframework.org/schema/context";</p> <p>   xsi:schemaLocation的值中要加:http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd;这两个东西(好像是约束,不知是啥)</p> <p>  spring3支持几种不同的用于自动装配的注解:</p> <ul><li>spring自带的@Autowierd注解;</li> <li>JSR-330的@Inject注解;</li> <li>JSR-250的@Resource注解;</li> </ul><h3>3.2.1 使用@Autowired</h3> <p>@Autowired是:org.springframework.beans.factory.annotation包下的Autowired接口如下:</p> <p>  <img alt="" class="b-lazy" data-src="https://images2015.cnblogs.com/blog/992219/201703/992219-20170321200825643-771118826.png" data-original="https://images2015.cnblogs.com/blog/992219/201703/992219-20170321200825643-771118826.png" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /></p> <p>  @Autowired的装配代码,比如,在Instrumentalist类型的setInstrument上标注@Autowired:</p> <img id="code_img_closed_03fe1a37-6062-4499-bfbb-8eb4cecc693b" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_03fe1a37-6062-4499-bfbb-8eb4cecc693b" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('03fe1a37-6062-4499-bfbb-8eb4cecc693b',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_03fe1a37-6062-4499-bfbb-8eb4cecc693b" class="cnblogs_code_hide"> <pre>1 //注入乐器 2 @Autowired 3 public void setInstrument(Instrument instrument) { 4 this.instrument = instrument; 5 } </pre> </div> <span class="cnblogs_code_collapse">View Code</span> <p>  在springbean.xml中:</p> <img id="code_img_closed_dd4c48e7-8e4a-4861-8751-f7c5575657d0" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_dd4c48e7-8e4a-4861-8751-f7c5575657d0" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('dd4c48e7-8e4a-4861-8751-f7c5575657d0',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_dd4c48e7-8e4a-4861-8751-f7c5575657d0" class="cnblogs_code_hide"> <pre>1 &lt;!-- Saxophone类型的bean --&gt; 2 &lt;!-- &lt;bean class="com.springinaction.springidol.Saxophone"&gt;&lt;/bean&gt; --&gt; 3 &lt;!--Guitar类型的bean(Instrument 乐器)--&gt; 4 &lt;bean class="com.springinaction.springidol.Guitar"&gt;&lt;/bean&gt; 5 6 &lt;bean id="kenny" 7 class="com.springinaction.springidol.Instrumentalist"&gt; 8 &lt;property name="song" value="演员——薛之谦"&gt;&lt;/property&gt; 9 &lt;/bean&gt;</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <p>  测试结果,这时容器中只有一个乐器类型的bean:</p> <img id="code_img_closed_d0cfd514-7bd6-40c2-876b-fef5611a73c3" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_d0cfd514-7bd6-40c2-876b-fef5611a73c3" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('d0cfd514-7bd6-40c2-876b-fef5611a73c3',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_d0cfd514-7bd6-40c2-876b-fef5611a73c3" class="cnblogs_code_hide"> <pre>1 //测试注解@Autowired 2 @Test 3 public void testAutowired() throws Exception { 4 5 Instrumentalist kenny = (Instrumentalist) ac.getBean("kenny"); 6 kenny.perform(); 7 kenny.getInstrument().play(); 8 9 }</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <p><img alt="" class="b-lazy" data-src="https://images2015.cnblogs.com/blog/992219/201703/992219-20170321201952658-199529814.png" data-original="https://images2015.cnblogs.com/blog/992219/201703/992219-20170321201952658-199529814.png" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /></p> <p>   当springbean.xml中有两个乐器类型的bean时,会抛异常BeanCreationException,还是bean不唯一的问题:</p> <p>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'kenny': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.springinaction.springidol.Instrumentalist.setInstrument(com.springinaction.springidol.Instrument); nested exception is org.springframework.beans.factory.<span style="color: #ff0000;">NoUniqueBeanDefinitionException</span>: No qualifying bean of type [com.springinaction.springidol.Instrument] is defined: expected single matching bean but found 2: com.springinaction.springidol.Saxophone#0,com.springinaction.springidol.Guitar#0:</p> <img id="code_img_closed_0fcb32f0-1c40-4b77-a1cd-4d83dbf2def3" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_0fcb32f0-1c40-4b77-a1cd-4d83dbf2def3" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('0fcb32f0-1c40-4b77-a1cd-4d83dbf2def3',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_0fcb32f0-1c40-4b77-a1cd-4d83dbf2def3" class="cnblogs_code_hide"> <pre>1 &lt;!-- Saxophone类型的bean,下面两个bean同时存在的时候,会抛异常NoUniqueBeanDefinitionException --&gt; 2 &lt;bean class="com.springinaction.springidol.Saxophone"&gt;&lt;/bean&gt; 3 &lt;!--Guitar类型的bean(Instrument 乐器)--&gt; 4 &lt;bean class="com.springinaction.springidol.Guitar"&gt;&lt;/bean&gt; 5 6 &lt;bean id="kenny" 7 class="com.springinaction.springidol.Instrumentalist"&gt; 8 &lt;property name="song" value="演员——薛之谦"&gt;&lt;/property&gt; 9 &lt;/bean&gt;</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <p>  上面就抛出异常;</p> <p>  @Autowired可以在构造器上面和属性上面(这里标注了就可以把setter方法删掉了)都可以标注;</p> <p>  当容器中没有自动装配的bean时,会抛出 NoSuchBeanDefinitionException(没有这样的bean定义异常):<br />Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.springinaction.springidol.Instrumentalist.setInstrument(com.springinaction.springidol.Instrument); nested exception is org.springframework.beans.factory.<span style="color: #ff0000;">NoSuchBeanDefinitionException</span>: No qualifying bean of type [com.springinaction.springidol.Instrument] found for <br />  这时候@Autowired(required=false)这样装配,自动装配可选,容器中没有改类型的bean,instrument值会是空:<br />   @Autowired(required=false)<br />     private Instrument instrument;</p> <p>  这时候抛异常会抛NullPointException;</p> <p>  若是@Autowired注解用在构造器上时,只有一个构造器上required设置为true,其他使用@Autowired注解所标注的构造器只能将required属性设置为false。</p> <p>为解决上述问题,可以使用注解@Qualifier("guitar"),配置如下,这种配置和第二章中的&lt;property name='instrument' ref='guitar'&gt;原理其实应该差不多(个人觉得):</p> <img id="code_img_closed_eae0c4c9-2535-4d9f-932d-f0255944cf50" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_eae0c4c9-2535-4d9f-932d-f0255944cf50" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('eae0c4c9-2535-4d9f-932d-f0255944cf50',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_eae0c4c9-2535-4d9f-932d-f0255944cf50" class="cnblogs_code_hide"> <pre>1 @Autowired(required=false) 2 @Qualifier("guitar") 3 private Instrument instrument; </pre> </div> <span class="cnblogs_code_collapse">View Code</span> <img id="code_img_closed_f93ab0e7-263b-4d85-b09e-29ba902e28c0" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_f93ab0e7-263b-4d85-b09e-29ba902e28c0" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('f93ab0e7-263b-4d85-b09e-29ba902e28c0',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_f93ab0e7-263b-4d85-b09e-29ba902e28c0" class="cnblogs_code_hide"> <pre>1 &lt;bean id="saxophone" class="com.springinaction.springidol.Saxophone"&gt;&lt;/bean&gt; 2 &lt;!--Guitar类型的bean(Instrument 乐器)--&gt; 3 &lt;bean id="guitar" class="com.springinaction.springidol.Guitar"&gt;&lt;/bean&gt; 4 5 &lt;bean id="kenny" 6 class="com.springinaction.springidol.Instrumentalist"&gt; 7 &lt;property name="song" value="演员——薛之谦"&gt;&lt;/property&gt; 8 &lt;/bean&gt;</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <p>  还可以如下进行配置:</p> <img id="code_img_closed_3ae32e00-d53d-49f6-bbbd-b39b5b35eaef" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_3ae32e00-d53d-49f6-bbbd-b39b5b35eaef" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('3ae32e00-d53d-49f6-bbbd-b39b5b35eaef',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_3ae32e00-d53d-49f6-bbbd-b39b5b35eaef" class="cnblogs_code_hide"> <pre>1 @Autowired(required=false) 2 //@Qualifier("guitar") 3 private Instrument instrument;</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <img id="code_img_closed_b5f4cfad-8920-4764-94ea-1e7b62a1bf5e" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_b5f4cfad-8920-4764-94ea-1e7b62a1bf5e" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('b5f4cfad-8920-4764-94ea-1e7b62a1bf5e',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_b5f4cfad-8920-4764-94ea-1e7b62a1bf5e" class="cnblogs_code_hide"> <pre> 1 package com.springinaction.springidol; 2 3 import org.springframework.beans.factory.annotation.Qualifier; 4 5 /** 6 * 7 * @ClassName: Guitar 8 * @Description: 乐器:吉他 9 * @author mao 10 * @date 2017年3月19日 下午8:15:44 11 * 12 */ 13 @Qualifier("stringed") 14 public class Guitar implements Instrument { 15 16 public Guitar(){ 17 18 } 19 20 public void play() { 21 System.out.println("guitar guitar guitar"); 22 } 23 24 }</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <img id="code_img_closed_4f5387a6-ab98-415b-bc99-bf0139e12149" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_4f5387a6-ab98-415b-bc99-bf0139e12149" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('4f5387a6-ab98-415b-bc99-bf0139e12149',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_4f5387a6-ab98-415b-bc99-bf0139e12149" class="cnblogs_code_hide"> <pre>1 &lt;bean class="com.springinaction.springidol.Guitar"&gt; 2 &lt;qualifier value="stringed"&gt;&lt;/qualifier&gt; 3 &lt;/bean&gt; 4 5 &lt;bean id="kenny" 6 class="com.springinaction.springidol.Instrumentalist"&gt; 7 &lt;property name="song" value="演员——薛之谦"&gt;&lt;/property&gt; 8 &lt;/bean&gt;</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <p>测试了一下&lt;qualifier value="stringed"&gt;&lt;/qualifier&gt;这个有没有都可以哎,我用的spring版本是spring4.2.9的,难道版本高了,功能也自动升级了,不是很明白:</p> <p> <span style="font-size: 16px;"><strong><span style="color: #ff0000;">创建自定义的限定器(Qualifiler)(这个感觉好吊的样子,因为看不懂,感觉像是自己创建了个自定义的注解)</span>:</strong></span></p> <p> 首先创建一个接口:</p> <img id="code_img_closed_7fa13ed4-526e-4619-973f-173ca479773f" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_7fa13ed4-526e-4619-973f-173ca479773f" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('7fa13ed4-526e-4619-973f-173ca479773f',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_7fa13ed4-526e-4619-973f-173ca479773f" class="cnblogs_code_hide"> <pre> 1 package com.springinaction.springidol; 2 3 import java.lang.annotation.ElementType; 4 import java.lang.annotation.Retention; 5 import java.lang.annotation.RetentionPolicy; 6 import java.lang.annotation.Target; 7 8 import org.springframework.beans.factory.annotation.Qualifier; 9 10 @Target({ElementType.FIELD,ElementType.PARAMETER,ElementType.TYPE}) 11 @Retention(RetentionPolicy.RUNTIME) 12 @Qualifier 13 public @interface StringedInstrument { 14 15 }</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <img id="code_img_closed_13215fd4-0762-4673-9600-e5438970c9f3" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_13215fd4-0762-4673-9600-e5438970c9f3" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('13215fd4-0762-4673-9600-e5438970c9f3',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_13215fd4-0762-4673-9600-e5438970c9f3" class="cnblogs_code_hide"> <pre> 1 package com.springinaction.springidol; 2 3 4 /** 5 * 6 * @ClassName: Guitar 7 * @Description: 乐器:吉他 8 * @author mao 9 * @date 2017年3月19日 下午8:15:44 10 * 11 */ 12 @StringedInstrument//好嘛?这应该是自定义的注解吧 13 public class Guitar implements Instrument { 14 15 public Guitar(){ 16 17 } 18 19 public void play() { 20 System.out.println("guitar guitar guitar"); 21 } 22 23 }</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <img id="code_img_closed_cec2d0ff-c3b9-48f7-8bf9-c06fdd9c8062" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_cec2d0ff-c3b9-48f7-8bf9-c06fdd9c8062" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('cec2d0ff-c3b9-48f7-8bf9-c06fdd9c8062',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_cec2d0ff-c3b9-48f7-8bf9-c06fdd9c8062" class="cnblogs_code_hide"> <pre>1 @Autowired 2 //@Qualifier("guitar") 3 @StringedInstrument 4 private Instrument instrument;</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <img id="code_img_closed_fe49efbf-b56a-47aa-8a63-d42d6ea12290" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_fe49efbf-b56a-47aa-8a63-d42d6ea12290" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('fe49efbf-b56a-47aa-8a63-d42d6ea12290',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_fe49efbf-b56a-47aa-8a63-d42d6ea12290" class="cnblogs_code_hide"> <pre>1 &lt;bean class="com.springinaction.springidol.Guitar"&gt; 2 &lt;!-- &lt;qualifier value="stringed"&gt;&lt;/qualifier&gt; 这一行有没有不影响 --&gt; 3 &lt;/bean&gt; 4 5 &lt;bean id="kenny" 6 class="com.springinaction.springidol.Instrumentalist"&gt; 7 &lt;property name="song" value="演员——薛之谦"&gt;&lt;/property&gt; 8 &lt;/bean&gt;</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <img id="code_img_closed_0109b7a5-9ce8-4c3e-8f2c-f3d5ba49e4a0" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_0109b7a5-9ce8-4c3e-8f2c-f3d5ba49e4a0" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('0109b7a5-9ce8-4c3e-8f2c-f3d5ba49e4a0',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_0109b7a5-9ce8-4c3e-8f2c-f3d5ba49e4a0" class="cnblogs_code_hide"> <pre>1 //测试注解@Autowired @StringedInstrument 2 @Test 3 public void testAutowired() throws Exception { 4 5 Instrumentalist kenny = (Instrumentalist) ac.getBean("kenny"); 6 kenny.perform(); 7 kenny.getInstrument().play(); 8 9 }</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <p>如果有多个乐器类被@StringedInstrument标注了,还需要再进行细粒度的控制,感觉这个太麻烦!要自定义很多个限定器!</p> <h3>3.2.2 借助@Inject实现基于标准的自动装配</h3> <p>JSR-330是一种依赖注入规范,更常见的叫法<span style="color: #ff0000;">at inject<span style="color: #000000;">;</span></span></p> <p><span style="color: #ff0000;"><span style="color: #000000;">这个要用到新的jar文件,javax.inject,所以pom.xml文件中需要引入该jar依赖;</span></span></p> <img id="code_img_closed_9c89eb4d-4a7f-4d65-9429-1568e3e6c580" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_9c89eb4d-4a7f-4d65-9429-1568e3e6c580" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('9c89eb4d-4a7f-4d65-9429-1568e3e6c580',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_9c89eb4d-4a7f-4d65-9429-1568e3e6c580" class="cnblogs_code_hide"> <pre>1 &lt;!-- JSR-330的标准注解 --&gt; 2 &lt;dependency&gt; 3 &lt;groupId&gt;javax.inject&lt;/groupId&gt; 4 &lt;artifactId&gt;javax.inject&lt;/artifactId&gt; 5 &lt;version&gt;1&lt;/version&gt; 6 &lt;/dependency&gt;</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <p>这个jar内容如下,总共就这些类:</p> <p><img alt="" class="b-lazy" data-src="https://images2015.cnblogs.com/blog/992219/201703/992219-20170321222714549-283564420.png" data-original="https://images2015.cnblogs.com/blog/992219/201703/992219-20170321222714549-283564420.png" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /></p> <p> </p> <p><span style="color: #ff0000;"><span style="color: #000000;">@Inject注解和@Autowired一样,可以用来自动装配属性、方法和构造器;与@Autowired不同的是,@Inject没有required属性。</span></span></p> <p><span style="color: #000000;">@Inject他也可以限定,用@Name,@Autowired用的@Qualifier:</span></p> <img id="code_img_closed_dbab2a4d-5644-4411-b224-9270dcb4bd58" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_dbab2a4d-5644-4411-b224-9270dcb4bd58" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('dbab2a4d-5644-4411-b224-9270dcb4bd58',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_dbab2a4d-5644-4411-b224-9270dcb4bd58" class="cnblogs_code_hide"> <pre>1 @Inject 2 @Named("guitar") 3 private Instrument instrument;</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <p>基本用法和@Autowired差不多,@Name和@Qualifier区别:前者是通过Bean的ID来表示可选择的Bean,后者是帮助我们缩小匹配Bean的选择范围(目前没有感觉到太大的差一性);</p> <h3>3.2.3 在注解注入中使用表达式</h3> <p>Spring3.0引入了@Value,可以装配String类型的值和基本类型的值,例如。</p> <p>@Value("Eruption")</p> <p>private String song;</p> <p>@Value与SpEL表达式配合,才能显示他的魔力(第二章中的SpEL表达式);</p> <h2>3.3 自动检测Bean</h2> <p>  &lt;context:annotation-config/&gt;需要显示定义&lt;bean&gt;,用&lt;context:annotation-scan&gt;允许spring自动检测Bean和定义Bean。为了配置Spring自动检测,需要使用&lt;context:conponent-scan&gt;元素代替&lt;context:annotation-config&gt;元素,元素会扫描指定的包及其所有子包,并查处自动注册的Spring Bean的类。</p> <img id="code_img_closed_90cd78ad-2b75-47fb-adb0-5dce26a29195" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_90cd78ad-2b75-47fb-adb0-5dce26a29195" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('90cd78ad-2b75-47fb-adb0-5dce26a29195',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_90cd78ad-2b75-47fb-adb0-5dce26a29195" class="cnblogs_code_hide"> <pre> 1 &lt;?xml version="1.0" encoding="UTF-8"?&gt; 2 &lt;beans xmlns="http://www.springframework.org/schema/beans" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 4 xmlns:context="http://www.springframework.org/schema/context" 5 xmlns:p="http://www.springframework.org/schema/p" 6 xsi:schemaLocation="http://www.springframework.org/schema/beans 7 http://www.springframework.org/schema/beans/spring-beans-4.0.xsd 8 http://www.springframework.org/schema/context 9 http://www.springframework.org/schema/context/spring-context-4.0.xsd"&gt; 10 &lt;context:component-scan 11 base-package="com.springinaction.springidol"&gt; &lt;/context:component-scan&gt; 12 &lt;/beans&gt;</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <h3>3.3.1 为自动检测标注Bean</h3> <p>  &lt;context:componment-scan&gt;查找使用构造型(stereotype)注解所标注的类:</p> <ul><li>@Component——通用的构造型注解,标识该类为Spring组件</li> <li>@Constroller——标识将该类定义为SpringMVC controller</li> <li>@Repository——标识将该类定义为数据仓库</li> <li>@Service——标识将该类定义为服务</li> </ul><img id="code_img_closed_a054b518-0a8c-44af-810a-1a33a17586af" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_a054b518-0a8c-44af-810a-1a33a17586af" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('a054b518-0a8c-44af-810a-1a33a17586af',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_a054b518-0a8c-44af-810a-1a33a17586af" class="cnblogs_code_hide"> <pre> 1 package com.springinaction.springidol; 2 3 import org.springframework.stereotype.Component; 4 5 6 /** 7 * 8 * @ClassName: Guitar 9 * @Description: 乐器:吉他 10 * @author mao 11 * @date 2017年3月19日 下午8:15:44 12 * 13 */ 14 //自动将该类注册为Spring Bean。Bean的ID默认无限定类名。在这种场景下,Guitar Bean的ID为guitar 15 @Component 16 public class Guitar implements Instrument { 17 18 public Guitar(){ 19 20 } 21 22 public void play() { 23 System.out.println("guitar guitar guitar"); 24 } 25 26 }</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <img id="code_img_closed_109d0885-79b4-45d4-96ef-461dff60f829" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_109d0885-79b4-45d4-96ef-461dff60f829" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('109d0885-79b4-45d4-96ef-461dff60f829',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_109d0885-79b4-45d4-96ef-461dff60f829" class="cnblogs_code_hide"> <pre> 1 package com.springinaction.springidol; 2 3 import javax.inject.Inject; 4 import javax.inject.Named; 5 6 import org.springframework.beans.factory.annotation.Value; 7 import org.springframework.stereotype.Component; 8 9 10 11 /** 12 * 13 * @ClassName: Instrumentalist 14 * @Description: 一个有天赋的音乐家 15 * @author mao 16 * @date 2017年3月19日 下午7:15:17 17 * 18 */ 19 //将该类注册到Spring容器中,显示的为其命名为eddie。即ID为eddie 20 @Component("eddie") 21 public class Instrumentalist implements Performer { 22 23 @Value("演员--薛之谦") 24 private String song; 25 26 @Inject 27 @Named("guitar") 28 private Instrument instrument; 29 30 //注入乐器 31 public void setInstrument(Instrument instrument) { 32 this.instrument = instrument; 33 } 34 public Instrument getInstrument() { 35 return instrument; 36 } 37 //注入歌曲 38 public void setSong(String song) { 39 this.song = song; 40 } 41 public String getSong() { 42 return song; 43 } 44 45 public Instrumentalist(){ 46 47 } 48 49 public void perform() throws Exception { 50 System.out.println("Playing "+song+": "); 51 } 52 53 }</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <img id="code_img_closed_482f9d30-e347-472a-95fe-44fbf3c21f22" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_482f9d30-e347-472a-95fe-44fbf3c21f22" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('482f9d30-e347-472a-95fe-44fbf3c21f22',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_482f9d30-e347-472a-95fe-44fbf3c21f22" class="cnblogs_code_hide"> <pre>1 //测试注解@Component 2 @Test 3 public void testComponent() throws Exception { 4 5 Instrumentalist eddie = (Instrumentalist) ac.getBean("eddie"); 6 eddie.perform(); 7 eddie.getInstrument().play(); 8 9 }</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <p>测试结果:</p> <p><img alt="" class="b-lazy" data-src="https://images2015.cnblogs.com/blog/992219/201703/992219-20170322104503908-1123703914.png" data-original="https://images2015.cnblogs.com/blog/992219/201703/992219-20170322104503908-1123703914.png" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /></p> <h2>3.4 使用spring基于java的配置</h2> <h3>3.4.1 创建基于Java的配置</h3> <p>  即使Spring的java配置可以使用XML就可以编写大多数的Spring配置,但是我们仍然需要极少量的XML来启用Java配置:</p> <img id="code_img_closed_d699a816-fd83-40de-abfd-139d9fdaa0cc" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_d699a816-fd83-40de-abfd-139d9fdaa0cc" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('d699a816-fd83-40de-abfd-139d9fdaa0cc',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_d699a816-fd83-40de-abfd-139d9fdaa0cc" class="cnblogs_code_hide"> <pre> 1 &lt;?xml version="1.0" encoding="UTF-8"?&gt; 2 &lt;beans xmlns="http://www.springframework.org/schema/beans" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 4 xmlns:context="http://www.springframework.org/schema/context" 5 xmlns:p="http://www.springframework.org/schema/p" 6 xsi:schemaLocation="http://www.springframework.org/schema/beans 7 http://www.springframework.org/schema/beans/spring-beans-4.0.xsd 8 http://www.springframework.org/schema/context 9 http://www.springframework.org/schema/context/spring-context-4.0.xsd"&gt; 10 &lt;context:component-scan 11 base-package="com.springinaction.springidol*"&gt;&lt;/context:component-scan&gt; 12 13 &lt;/beans&gt;</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <p>  首先创建一个类,用@Configuration标注该类,使用它标注后,这个类就相当于&lt;beans&gt;容器了:</p> <img id="code_img_closed_745e8379-d382-48af-86b6-de819912802f" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_745e8379-d382-48af-86b6-de819912802f" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('745e8379-d382-48af-86b6-de819912802f',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_745e8379-d382-48af-86b6-de819912802f" class="cnblogs_code_hide"> <pre> 1 package com.springinaction.springidol; 2 3 import org.springframework.context.annotation.Bean; 4 import org.springframework.context.annotation.Configuration; 5 6 //在基于java的配置里使用@Configuration注解java类,就等价于XML配置中的&lt;beans&gt; 7 //@Configuration注解会作为一个标识告知Spring:这个类将包含一个多个SpringBean的定义。 8 //这些Bean的定义是使用@Bean注解所标注的方法。 9 @Configuration 10 public class SpingIdolConfig { 11 12 /* 13 * 它等价于使用XML所配置的&lt;bean&gt;元素。@Bean告知Sping这个方法返回一个对象, 14 * 该对象应该被注册为Spring应用上下文中的一个Bean。方法名将作为该Bean的ID 15 */ 16 @Bean 17 public Performer duke(){ 18 return new Juggler(); 19 } 20 21 @Bean 22 public Performer kenny(){ 23 24 Instrumentalist kenny = new Instrumentalist(); 25 kenny.setSong("认真的雪Bean----薛之谦"); 26 kenny.setInstrument(guitar()); 27 return kenny; 28 29 } 30 31 @Bean 32 public Instrument guitar(){ 33 return new Guitar(); 34 } 35 36 }</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <p>  此时Instrumentalist类是这样的,两个属性的注解被注释了:</p> <img id="code_img_closed_a2c2a061-72a0-431e-8569-3845a89a3a91" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_a2c2a061-72a0-431e-8569-3845a89a3a91" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('a2c2a061-72a0-431e-8569-3845a89a3a91',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_a2c2a061-72a0-431e-8569-3845a89a3a91" class="cnblogs_code_hide"> <pre> 1 package com.springinaction.springidol; 2 3 import javax.inject.Inject; 4 import javax.inject.Named; 5 6 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Qualifier; 8 import org.springframework.beans.factory.annotation.Value; 9 import org.springframework.stereotype.Component; 10 11 12 13 /** 14 * 15 * @ClassName: Instrumentalist 16 * @Description: 一个有天赋的音乐家 17 * @author mao 18 * @date 2017年3月19日 下午7:15:17 19 * 20 */ 21 //将该类注册到Spring容器中,显示的为其命名为eddie。即ID为eddie 22 23 public class Instrumentalist implements Performer { 24 25 // @Value("演员---薛之谦") 26 private String song; 27 28 // @Autowired 29 // @Qualifier("saxophone") 30 private Instrument instrument; 31 32 //注入乐器 33 public void setInstrument(Instrument instrument) { 34 this.instrument = instrument; 35 } 36 public Instrument getInstrument() { 37 return instrument; 38 } 39 //注入歌曲 40 public void setSong(String song) { 41 this.song = song; 42 } 43 public String getSong() { 44 return song; 45 } 46 47 public Instrumentalist(){ 48 49 } 50 51 public void perform() throws Exception { 52 System.out.println("Playing "+song+": "); 53 } 54 55 }</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <p>  测试代码:</p> <img id="code_img_closed_a8697aaf-da0f-4b24-a78b-5032b3c4e9d3" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_a8697aaf-da0f-4b24-a78b-5032b3c4e9d3" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('a8697aaf-da0f-4b24-a78b-5032b3c4e9d3',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_a8697aaf-da0f-4b24-a78b-5032b3c4e9d3" class="cnblogs_code_hide"> <pre>1 //测试基于java的配置 2 @Test 3 public void testJava() throws Exception { 4 5 Instrumentalist eddie = (Instrumentalist) ac.getBean("kenny"); 6 eddie.perform(); 7 eddie.getInstrument().play(); 8 9 }</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <p>  结果:</p> <p><img alt="" class="b-lazy" data-src="https://images2015.cnblogs.com/blog/992219/201703/992219-20170322115201252-573123865.png" data-original="https://images2015.cnblogs.com/blog/992219/201703/992219-20170322115201252-573123865.png" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /></p> <p>  这个基于java的注解,若是将上述的两个注释的注解解封:</p> <img id="code_img_closed_3e6db0c9-fbca-489a-baaf-7b4366414c17" class="code_img_closed b-lazy" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><img id="code_img_opened_3e6db0c9-fbca-489a-baaf-7b4366414c17" class="code_img_opened b-lazy" style="display: none;" onclick="cnblogs_code_hide('3e6db0c9-fbca-489a-baaf-7b4366414c17',event)" alt="" data-src="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" data-original="https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><div id="cnblogs_code_open_3e6db0c9-fbca-489a-baaf-7b4366414c17" class="cnblogs_code_hide"> <pre> 1 package com.springinaction.springidol; 2 3 import javax.inject.Inject; 4 import javax.inject.Named; 5 6 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Qualifier; 8 import org.springframework.beans.factory.annotation.Value; 9 import org.springframework.stereotype.Component; 10 11 12 13 /** 14 * 15 * @ClassName: Instrumentalist 16 * @Description: 一个有天赋的音乐家 17 * @author mao 18 * @date 2017年3月19日 下午7:15:17 19 * 20 */ 21 //将该类注册到Spring容器中,显示的为其命名为eddie。即ID为eddie 22 23 public class Instrumentalist implements Performer { 24 25 @Value("演员---薛之谦") 26 private String song; 27 28 @Autowired 29 @Qualifier("saxophone") 30 private Instrument instrument; 31 32 //注入乐器 33 public void setInstrument(Instrument instrument) { 34 this.instrument = instrument; 35 } 36 public Instrument getInstrument() { 37 return instrument; 38 } 39 //注入歌曲 40 public void setSong(String song) { 41 this.song = song; 42 } 43 public String getSong() { 44 return song; 45 } 46 47 public Instrumentalist(){ 48 49 } 50 51 public void perform() throws Exception { 52 System.out.println("Playing "+song+": "); 53 } 54 55 }</pre> </div> <span class="cnblogs_code_collapse">View Code</span> <p>  结果就是:</p> <p><img alt="" class="b-lazy" data-src="https://images2015.cnblogs.com/blog/992219/201703/992219-20170322115814643-1703288267.png" data-original="https://images2015.cnblogs.com/blog/992219/201703/992219-20170322115814643-1703288267.png" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /></p> <p>  这个感觉像是就近原则啊(xml的注解在属性上方),要么是先是执行了基于java的配置,后又执行了基于xml的配置,xml的配置覆盖了前者的结果。</p> <p> <span style="font-size: 18px;"><strong><a href="https://github.com/huaxueyihao/spring-in-action" rel="nofollow">源码下载地址</a></strong></span></p> <div class="alert alert-success" role="alert"><p>来源:<code>https://www.cnblogs.com/huaxueyihao/p/6594501.html</code></p></div></div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">标签</div> <div class="field--items"> <div class="field--item"><a href="/tag/springzidingyizhujie" hreflang="zh-hans">spring自定义注解</a></div> <div class="field--item"><a href="/tag/springyuanli" hreflang="zh-hans">spring原理</a></div> <div class="field--item"><a href="/tag/eddie" hreflang="zh-hans">eddie</a></div> <div class="field--item"><a href="/tag/string" hreflang="zh-hans">string</a></div> <div class="field--item"><a href="/tag/bean" hreflang="zh-hans">bean</a></div> </div> </div> Wed, 12 Feb 2020 23:37:37 +0000 左心房为你撑大大i 3389658 at https://www.e-learn.cn Eddie for Mac(代码编辑工具) v3.4 https://www.e-learn.cn/topic/1802807 <span>Eddie for Mac(代码编辑工具) v3.4</span> <span><span lang="" about="/user/132" typeof="schema:Person" property="schema:name" datatype="">时光总嘲笑我的痴心妄想</span></span> <span>2019-12-06 06:37:41</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><div id="cnblogs_post_body" class="blogpost-body"> <p>Eddie for Mac版代码编辑工具可以搭配使用的相关免费资源相当的多,Mac代码编辑工具提供了很多常用的HTML任务选项,例如字体、表格等等,当然还有链接,这个软件是用了一个比较不常见的“链接描述”来表明可点击的链接。</p> <p></p><p></p><img class="b-lazy" data-src="https://www.eimg.top/images/2020/01/09/bd48a6e986ff90e46bb0f1188b2440d3.jpg" data-original="https://www.eimg.top/images/2020/01/09/bd48a6e986ff90e46bb0f1188b2440d3.jpg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><p></p> <p>Eddie是MacOSX的程序员编辑。<br />它非常适合重型C ++ / C ++ 17 / Obj-C开发,它能够编辑HTML,Swift,JavaScript,Python,Ruby,Lua,Ragel或任何旧的纯文本文件。<br />作为一款完全原生的现代Cocoa应用程序,Eddie在其DNA上具有速度和响应能力,借鉴了它在BeOS上的简单起源<br />Eddie中的工作表是一个功能齐全的外壳,它结合了终端的强大功能和普通文档中的易编辑性。受到Macintosh Programmer's Workshop的启发,Eddie将其中的一些革命性功能带入了现代程序员的编辑器中。</p> <p></p><p></p><img class="b-lazy" data-src="https://www.eimg.top/images/2020/01/09/2e709d4887fafcd0dc6d911327024b90.jpg" data-original="https://www.eimg.top/images/2020/01/09/2e709d4887fafcd0dc6d911327024b90.jpg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><p></p> <p class="intro">eddie mac版功能特征</p> <p>功能齐全的编辑器,具有一系列强大的编辑命令,无限制的撤销,创新的键盘快捷键,如Smart Swap<br />即使在处理大量源文件时,轻量级,快速且响应迅速<br />工作表窗口集成了完整的bash shell,具有完全可编辑性,增强的Tab-completion支持<br />C / C ++ 17 / Obj-C,makefile,HTML,Swift,Lua,Python,Ruby,LaTeX,Ragel,Antlr和许多其他文件格式的快速和精确的语法着色<br />具有完整C / C ++ 17 / Obj-C支持,HTML,Swift,JavaScript,Perl,Lua,Python,Ragel,Bison的函数弹出窗口<br />Magic prototyper极大地简化了C ++和Obj-C的开发<br />具有符号查找和C / C ++ / Obj-C和Python代码的代码完成的高级索引器<br />C ++压头(仍处于测试阶段)<br />丰富的#ifdef平衡,评论<br />搜索/替换支持正则表达式,多文件,增量搜索以及独特的多查找/多替换功能<br />多个剪贴板支持历史记录中的粘贴,可编辑剪贴板弹出窗口以及用于复杂重复复制粘贴作业的扩展功能集<br />智能剪贴板允许配置复杂的复制粘贴操作的自动化<br />工作集允许将文件组织成类似项目的组<br />支持自动生成makefile<br />支持Git,Subversion,Perforce和CVS等源代码控制系统<br />Windows可以作为选项卡打开或拆分为多个窗格<br />打开并保存到SFTP服务器允许编辑远程,就像它们是本地的一样<br />每个键盘快捷键都可以从一个超级广泛的快捷键原语列表中完全配置<br />广泛的插件API使插件可以完全控制应用程序</p> <p></p><p></p><img class="b-lazy" data-src="https://www.eimg.top/images/2020/01/09/9088add96a553fcc20ed6bc2b40e3b4a.jpg" data-original="https://www.eimg.top/images/2020/01/09/9088add96a553fcc20ed6bc2b40e3b4a.jpg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" /><p></p> <p class="intro">eddie mac版更新日志</p> <p>Eddie for Mac(代码编辑工具) v3.4免费版版本新功能</p> <p>迅速<br />-索引编制/自动完成测试版<br />-功能弹出解析改进<br />-语法着色改进<br />-固定报价平衡<br />C ++<br />-索引编制/自动完成修复<br />-调整了注释者逻辑,以更好地处理注释和非注释行的选择<br />-压头修复<br />高朗<br />-添加了语法着色<br />-增加了功能弹出窗口<br />降价促销<br />-添加了语法着色<br />-增加了功能弹出窗口<br />查找和替换<br />-修正了“ .h&.c”查找窗口文件类型菜单<br />-修复了“全部替换”有时在首次查找时不起作用的问题<br />-在长时间多文件替换期间强制向上查找窗口<br />-修复了多文件查找中全部替换问题的数量<br />-当选择匹配找到匹配项时,允许替换,而不仅仅是匹配匹配项<br />-在正则表达式模式下正确设置UTF8搜索字符串的颜色<br />#ifdef平衡器<br />-勾勒出包围当前选择的所有#ifdef,而不仅仅是直接选择<br />功能弹出<br />-制作“ MARKER:-”并正确发送菜单分隔符<br />分割窗格<br />-更好的渲染分割器拇指<br />-更好地呈现焦点轮廓<br />-拆分窗格时正确更新状态栏<br />其他修复和改进<br />-添加了“通过匹配定界符来包装选择”<br />-空格剥离改进<br />-每个文件类型可配置的杂散空格显示<br />-修复了在换行文本中出现的空白显示<br />-更好地处理nbsp和其他UTF8字符<br />-删除了智能剪贴板中对$ SELECTED_TEXT的任意限制<br />-使临时Shell执行对从Shell配置文件初始喷出的弹性具有弹性<br />崩溃:<br />-修复了移动父文档文件夹后打开索引文档时崩溃的问题<br />-修复了在Mojave上的文档列表窗口中拖动项目时崩溃的问题<br />-修复了在撕下标签后多文件查找过程中崩溃的问题<br />-修复了一些Catalina兼容性问题</p> </div><div class="alert alert-warning" role="alert"><p>来源:<code>https://www.cnblogs.com/macdown/p/11965841.html</code></p></div></div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">标签</div> <div class="field--items"> <div class="field--item"><a href="/tag/mac" hreflang="zh-hans">mac</a></div> <div class="field--item"><a href="/tag/eddie" hreflang="zh-hans">eddie</a></div> </div> </div> Thu, 05 Dec 2019 22:37:41 +0000 时光总嘲笑我的痴心妄想 1802807 at https://www.e-learn.cn es 搜索功能简介 https://www.e-learn.cn/topic/1504696 <span>es 搜索功能简介</span> <span><span lang="" about="/user/201" typeof="schema:Person" property="schema:name" datatype="">不羁的心</span></span> <span>2019-12-04 03:55:32</span> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><div id="cnblogs_post_body" class="blogpost-body"> <p>DSL 语法介绍</p> <table border="0" align="center"><tbody><tr><td>语法</td> <td>范围</td> </tr><tr><td>/_search</td> <td>集群上搜索所有的索引</td> </tr><tr><td>/index1/_search</td> <td>index1</td> </tr><tr><td>/index1,index2/_search</td> <td>index1和index2</td> </tr><tr><td>/index*/_search</td> <td>以index开头的索引</td> </tr></tbody></table><p>RUL 查询;使用q,指定查询字符串,查询内容是kv键值对</p> <div> <pre> curl -XGET "http://127.0.0.1:9200/kibana_sample_data_ecommerce/_search?q=customer_first_name:Eddie" {"took":3,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":100,"relation":"eq"},"max_score":4.016948,"hits":[{"_index":"kibana_sample_dat a_ecommerce","_type":"_doc","_id":"UXYbP24B9uEN4vPiBjWP","_score":4.016948,"_source":{"category":["Men's Clothing"],"currency":"EUR","customer_first_name":"Eddie","customer_full_name":"Eddie Underwood","customer_gender":"MALE","customer_id":38,"customer_last_name":"Underwood","customer_phone":"","day_of_week":"Monday","day_of_week_i":0,"email":"eddie@underwood-family.zzz","manufacturer":["Elitelligence","Oceanavigations"],"order_date":"2019-11-25T09:28:48+00:00","order_id":584677,"products":[{"base_price":11.99,"discount_percentage":0,"quantity":1,"manufacturer":"Elitelligence","tax_amount":0,"product_id":6283,"category":"Men's Clothing","sku":"ZO0549605496","taxless_price":11.99,"unit_discount_amount":0,"min_price":6.35,"_id":"sold_product_584677_6283","discount_amount":0,"created_on":"2016-12-26T09:28:48+00:00","product_name":"Basic T-shirt - dark blue/white","price":11.99,"taxful_price":11.99,"base_unit_price":11.99},{"base_price":24.99,"discount_percentage":0,"quantity":1,"manufacturer":"Oceanavigations","tax_amount":0,"product_id":19400,"category":"Men's Clothing","sku":"ZO0299602996","taxless_price":24.99,"unit_discount_amount":0,"min_price":11.75,"_id":"sold_product_584677_19400","discount_amount":0,"created_on":"2016-12-26T09:28:48+00:00","product_name":"Sweatshirt - grey multicolor","price":24.99,"taxful_price":24.99,"base_unit_price":24.99}],"sku":["ZO0549605496","ZO0299602996"],"taxful_total_price":36.98,"taxless_total_price":36.98,"total_quantity":2,"total_unique_products":2,"type":"order","user":"eddie","geoip":{"country_iso_code":"EG","location":{"lon":31.3,"lat":30.1},"region_name":"Cairo Governorate","continent_name":"Africa","city_name":"Cairo"}}},{"_index":"kibana_sample_data_ecommerce","_type":"_doc","_id":"VXYbP24B9uEN4vPiBjWP","_score":4.016948,"_source":{"category":["Men's Clothing","Men's Accessories"],"currency":"EUR","customer_first_name":"Eddie","customer_full_name":"Eddie Weber","customer_gender":"MALE","customer_id":38,"customer_last_name":"Weber","customer_phone":"","day_of_week":"Monday","day_of_week_i":0,"email":"eddie@weber-family.zzz","manufacturer":["Elitelligence"],"order_date":"2019-11-18T03:48:58+00:00","order_id":574916,"products":[{"base_price":59.99,"discount_percentage":0,"quantity":1,"manufacturer":"Elitelligence","tax_amount":0,"product_id":11262,"category":"Men's Clothing","sku":"ZO0542505425","taxless_price":59.99,"unit_discount_amount":0,"min_price":28.2,"_id":"sold_product_574916_11262","discount_amount":0,"created_on":"2016-12-19T03:48:58+00:00","product_name":"Winter jacket - black","price":59.99,"taxful_price":59.99,"base_unit_price":59.99},{"base_price":20.99,"discount_percentage":0,"quantity":1,"manufacturer":"Elitelligence","tax_amount":0,"product_id":15713,"category":"Men's Accessories","sku":"ZO0601306013","taxless_price":20.99,"unit_discount_amount":0,"min_price":10.7,"_id":"sold_product_574916_15713","discount_amount":0,"created_on":"2016-12-19T03:48:58+00:00","product_name":"Watch - green","price":20.99,"taxful_price":20.99,"base_unit_price":20.99}],"sku":["ZO0542505425","ZO0601306013"],"taxful_total_price":80.98,"taxless_total_price":80.98,"total_quantity":2,"total_unique_products":2,"type":"order","user":"eddie","geoip":{"country_iso_code":"EG","location":{"lon":31.3,"lat":30.1},"region_name":"Cairo Governorate","continent_name":"Africa","city_name":"Cairo"}}},{"_index":"kibana_sample_data_ecommerce","_type":"_doc","_id":"XHYbP24B9uEN4vPiBjWQ","_score":4.016948,"_source":{"category":["Men's Accessories","Men's Clothing"],"currency":"EUR","customer_first_name":"Eddie","customer_full_name":"Eddie Gregory","customer_gender":"MALE","customer_id":38,"customer_last_name":"Gregory","customer_phone":"","day_of_week":"Tuesday","day_of_week_i":1,"email":"eddie@gregory-family.zzz","manufacturer":["Angeldale","Low Tide Media","Oceanavigations","Elitelligence"],"order_date":"2019-11-26T13:10:34+00:00","order_id":718424,"products":[{"base_price":17.99,"discount_percentage":0,"quantity":1,"manufacturer":"Angeldale","tax_amount":0,"product_id":19655,"category":"Men's Accessories","sku":"ZO0700707007","taxless_price":17.99,"unit_discount_amount":0,"min_price":8.28,"_id":"sold_product_718424_19655","discount_amount":0,"created_on":"2016-12-27T13:10:34+00:00","product_name":"Belt - black","price":17.99,"taxful_price":17.99,"base_unit_price":17.99},{"base_price":10.99,"discount_percentage":0,"quantity":1,"manufacturer":"Low Tide Media","tax_amount":0,"product_id":12500,"category":"Men's Accessories","sku":"ZO0459704597","taxless_price":10.99,"unit_discount_amount":0,"min_price":5.06,"_id":"sold_product_718424_12500","discount_amount":0,"created_on":"2016-12-27T13:10:34+00:00","product_name":"Gloves - dark grey multicolor/bordeaux","price":10.99,"taxful_price":10.99,"base_unit_price":10.99},{"base_price":16.99,"discount_percentage":0,"quantity":1,"manufacturer":"Oceanavigations","tax_amount":0,"product_id":17739,"category":"Men's Clothing","sku":"ZO0293702937","taxless_price":16.99,"unit_discount_amount":0,"min_price":8.83,"_id":"sold_product_718424_17739","discount_amount":0,"created_on":"2016-12-27T13:10:34+00:00","product_name":"Long sleeved top - khaki","price":16.99,"taxful_price":16.99,"base_unit_price":16.99},{"base_price":22.99,"discount_percentage":0,"quantity":1,"manufacturer":"Elitelligence","tax_amount":0,"product_id":23793,"category":"Men's Clothing","sku":"ZO0592705927","taxless_price":22.99,"unit_discount_amount":0,"min_price":11.04,"_id":"sold_product_718424_23793","discount_amount":0,"created_on":"2016-12-27T13:10:34+00:00","product_name":"Hoodie - mottled light grey","price":22.99,"taxful_price":22.99,"base_unit_price":22.99}],"sku":["ZO0700707007","ZO0459704597","ZO0293702937","ZO0592705927"],"taxful_total_price":68.96,"taxless_total_price":68.96,"total_quantity":4,"total_unique_products":4,"type":"order","user":"eddie","geoip":{"country_iso_code":"EG","location":{"lon":31.3,"lat":30.1},"region_name":"Cairo Governorate","continent_name":"Africa","city_name":"Cairo"}}},{"_index":"kibana_sample_data_ecommerce","_type":"_doc","_id":"XnYbP24B9uEN4vPiBjWQ","_score":4.016948,"_source":{"category":["Men's Clothing"],"currency":"EUR","customer_first_name":"Eddie","customer_full_name":"Eddie Wolfe","customer_gender":"MALE","customer_id":38,"customer_last_name":"Wolfe","customer_phone":"","day_of_week":"Monday","day_of_week_i":0,"email":"eddie@wolfe-family.zzz","manufacturer":["Elitelligence","Oceanavigations","Low Tide Media"],"order_date":"2019-11-18T19:59:31+00:00","order_id":715061,"products":[{"base_price":28.99,"discount_percentage":0,"quantity":1,"manufacturer":"Elitelligence","tax_amount":0,"product_id":13695,"category":"Men's Clothing","sku":"ZO0590205902","taxless_price":28.99,"unit_discount_amount":0,"min_price":14.21,"_id":"sold_product_715061_13695","discount_amount":0,"created_on":"2016-12-19T19:59:31+00:00","product_name":"Sweatshirt - white","price":28.99,"taxful_price":28.99,"base_unit_price":28.99},{"base_price":199.99,"discount_percentage":0,"quantity":1,"manufacturer":"Oceanavigations","tax_amount":0,"product_id":16955,"category":"Men's Clothing","sku":"ZO0291402914","taxless_price":199.99,"unit_discount_amount":0,"min_price":92,"_id":"sold_product_715061_16955","discount_amount":0,"created_on":"2016-12-19T19:59:31+00:00","product_name":"Classic coat - navy","price":199.99,"taxful_price":199.99,"base_unit_price":199.99},{"base_price":24.99,"discount_percentage":0,"quantity":1,"manufacturer":"Oceanavigations","tax_amount":0,"product_id":16663,"category":"Men's Clothing","sku":"ZO0297002970","taxless_price":24.99,"unit_discount_amount":0,"min_price":12.25,"_id":"sold_product_715061_16663","discount_amount":0,"created_on":"2016-12-19T19:59:31+00:00","product_name":"Jumper - dark grey multicolor","price":24.99,"taxful_price":24.99,"base_unit_price":24.99},{"base_price":12.99,"discount_percentage":0,"quantity":1,"manufacturer":"Low Tide Media","tax_amount":0,"product_id":14513,"category":"Men's Clothing","sku":"ZO0476504765","taxless_price":12.99,"unit_discount_amount":0,"min_price":7.14,"_id":"sold_product_715061_14513","discount_amount":0,"created_on":"2016-12-19T19:59:31+00:00","product_name":"3 PACK - Shorts - Blue Violety/navy/grey","price":12.99,"taxful_price":12.99,"base_unit_price":12.99}],"sku":["ZO0590205902","ZO0291402914","ZO0297002970","ZO0476504765"],"taxful_total_price":266.96,"taxless_total_price":266.96,"total_quantity":4,"total_unique_products":4,"type":"order","user":"eddie","geoip":{"country_iso_code":"EG","location":{"lon":31.3,"lat":30.1},"region_name":"Cairo Governorate","continent_name":"Africa","city_name":"Cairo"}}},{"_index":"kibana_sample_data_ecommerce","_type":"_doc","_id":"H3YbP24B9uEN4vPiBjaU","_score":4.016948,"_source":{"category":["Men's Clothing"],"currency":"EUR","customer_first_name":"Eddie","customer_full_name":"Eddie Simpson","customer_gender":"MALE","customer_id":38,"customer_last_name":"Simpson","customer_phone":"","day_of_week":"Sunday","day_of_week_i":6,"email":"eddie@simpson-family.zzz","manufacturer":["Low Tide Media"],"order_date":"2019-11-17T06:25:55+00:00","order_id":573745,"products":[{"base_price":28.99,"discount_percentage":0,"quantity":1,"manufacturer":"Low Tide Media","tax_amount":0,"product_id":23923,"category":"Men's Clothing","sku":"ZO0421804218","taxless_price":28.99,"unit_discount_amount":0,"min_price":14.21,"_id":"sold_product_573745_23923","discount_amount":0,"created_on":"2016-12-18T06:25:55+00:00","product_name":"Chinos - dark blue","price":28.99,"taxful_price":28.99,"base_unit_price":28.99},{"base_price":10.99,"discount_percentage":0,"quantity":1,"manufacturer":"Low Tide Media","tax_amount":0,"product_id":17547,"category":"Men's Clothing","sku":"ZO0435704357","taxless_price":10.99,"unit_discount_amount":0,"min_price":5.71,"_id":"sold_product_573745_17547","discount_amount":0,"created_on":"2016-12-18T06:25:55+00:00","product_name":"Basic T-shirt - light grey multicolor","price":10.99,"taxful_price":10.99,"base_unit_price":10.99}],"sku":["ZO0421804218","ZO0435704357"],"taxful_total_price":39.98,"taxless_total_price":39.98,"total_quantity":2,"total_unique_products":2,"type":"order","user":"eddie","geoip":{"country_iso_code":"EG","location":{"lon":31.3,"lat":30.1},"region_name":"Cairo Governorate","continent_name":"Africa","city_name":"Cairo"}}},{"_index":"kibana_sample_data_ecommerce","_type":"_doc","_id":"JHYbP24B9uEN4vPiBjaU","_score":4.016948,"_source":{"category":["Men's Clothing","Men's Shoes"],"currency":"EUR","customer_first_name":"Eddie","customer_full_name":"Eddie Riley","customer_gender":"MALE","customer_id":38,"customer_last_name":"Riley","customer_phone":"","day_of_week":"Thursday","day_of_week_i":3,"email":"eddie@riley-family.zzz","manufacturer":["Spritechnologies","Elitelligence","Low Tide Media"],"order_date":"2019-11-28T05:54:14+00:00","order_id":717415,"products":[{"base_price":74.99,"discount_percentage":0,"quantity":1,"manufacturer":"Spritechnologies","tax_amount":0,"product_id":19307,"category":"Men's Clothing","sku":"ZO0623206232","taxless_price":74.99,"unit_discount_amount":0,"min_price":36.75,"_id":"sold_product_717415_19307","discount_amount":0,"created_on":"2016-12-29T05:54:14+00:00","product_name":"Parka - navy blazer","price":74.99,"taxful_price":74.99,"base_unit_price":74.99},{"base_price":20.99,"discount_percentage":0,"quantity":1,"manufacturer":"Elitelligence","tax_amount":0,"product_id":14146,"category":"Men's Clothing","sku":"ZO0612506125","taxless_price":20.99,"unit_discount_amount":0,"min_price":11.54,"_id":"sold_product_717415_14146","discount_amount":0,"created_on":"2016-12-29T05:54:14+00:00","product_name":"Swimming shorts - banana","price":20.99,"taxful_price":20.99,"base_unit_price":20.99},{"base_price":32.99,"discount_percentage":0,"quantity":1,"manufacturer":"Elitelligence","tax_amount":0,"product_id":14250,"category":"Men's Shoes","sku":"ZO0517405174","taxless_price":32.99,"unit_discount_amount":0,"min_price":15.51,"_id":"sold_product_717415_14250","discount_amount":0,"created_on":"2016-12-29T05:54:14+00:00","product_name":"High-top trainers - grey","price":32.99,"taxful_price":32.99,"base_unit_price":32.99},{"base_price":20.99,"discount_percentage":0,"quantity":1,"manufacturer":"Low Tide Media","tax_amount":0,"product_id":19880,"category":"Men's Clothing","sku":"ZO0445204452","taxless_price":20.99,"unit_discount_amount":0,"min_price":11.54,"_id":"sold_product_717415_19880","discount_amount":0,"created_on":"2016-12-29T05:54:14+00:00","product_name":"Polo shirt - Medium Slate Blue","price":20.99,"taxful_price":20.99,"base_unit_price":20.99}],"sku":["ZO0623206232","ZO0612506125","ZO0517405174","ZO0445204452"],"taxful_total_price":149.96,"taxless_total_price":149.96,"total_quantity":4,"total_unique_products":4,"type":"order","user":"eddie","geoip":{"country_iso_code":"EG","location":{"lon":31.3,"lat":30.1},"region_name":"Cairo Governorate","continent_name":"Africa","city_name":"Cairo"}}},{"_index":"kibana_sample_data_ecommerce","_type":"_doc","_id":"PnYbP24B9uEN4vPiBjaV","_score":4.016948,"_source":{"category":["Men's Clothing"],"currency":"EUR","customer_first_name":"Eddie","customer_full_name":"Eddie Graham","customer_gender":"MALE","customer_id":38,"customer_last_name":"Graham","customer_phone":"","day_of_week":"Thursday","day_of_week_i":3,"email":"eddie@graham-family.zzz","manufacturer":["Low Tide Media","Oceanavigations","Elitelligence"],"order_date":"2019-11-21T16:12:00+00:00","order_id":719618,"products":[{"base_price":21.99,"discount_percentage":0,"quantity":1,"manufacturer":"Low Tide Media","tax_amount":0,"product_id":12461,"category":"Men's Clothing","sku":"ZO0449604496","taxless_price":21.99,"unit_discount_amount":0,"min_price":10.34,"_id":"sold_product_719618_12461","discount_amount":0,"created_on":"2016-12-22T16:12:00+00:00","product_name":"Jumper - dark blue","price":21.99,"taxful_price":21.99,"base_unit_price":21.99},{"base_price":41.99,"discount_percentage":0,"quantity":1,"manufacturer":"Oceanavigations","tax_amount":0,"product_id":17481,"category":"Men's Clothing","sku":"ZO0287802878","taxless_price":41.99,"unit_discount_amount":0,"min_price":20.16,"_id":"sold_product_719618_17481","discount_amount":0,"created_on":"2016-12-22T16:12:00+00:00","product_name":"Waistcoat - bright blue","price":41.99,"taxful_price":41.99,"base_unit_price":41.99},{"base_price":24.99,"discount_percentage":0,"quantity":1,"manufacturer":"Elitelligence","tax_amount":0,"product_id":15234,"category":"Men's Clothing","sku":"ZO0526105261","taxless_price":24.99,"unit_discount_amount":0,"min_price":11.5,"_id":"sold_product_719618_15234","discount_amount":0,"created_on":"2016-12-22T16:12:00+00:00","product_name":"Chinos - olive","price":24.99,"taxful_price":24.99,"base_unit_price":24.99},{"base_price":10.99,"discount_percentage":0,"quantity":1,"manufacturer":"Elitelligence","tax_amount":0,"product_id":12663,"category":"Men's Clothing","sku":"ZO0561005610","taxless_price":10.99,"unit_discount_amount":0,"min_price":5.93,"_id":"sold_product_719618_12663","discount_amount":0,"created_on":"2016-12-22T16:12:00+00:00","product_name":"Print T-shirt - dark blue","price":10.99,"taxful_price":10.99,"base_unit_price":10.99}],"sku":["ZO0449604496","ZO0287802878","ZO0526105261","ZO0561005610"],"taxful_total_price":99.96,"taxless_total_price":99.96,"total_quantity":4,"total_unique_products":4,"type":"order","user":"eddie","geoip":{"country_iso_code":"EG","location":{"lon":31.3,"lat":30.1},"region_name":"Cairo Governorate","continent_name":"Africa","city_name":"Cairo"}}},{"_index":"kibana_sample_data_ecommerce","_type":"_doc","_id":"Y3YbP24B9uEN4vPiBjaW","_score":4.016948,"_source":{"category":["Men's Clothing","Women's Accessories"],"currency":"EUR","customer_first_name":"Eddie","customer_full_name":"Eddie Clayton","customer_gender":"MALE","customer_id":38,"customer_last_name":"Clayton","customer_phone":"","day_of_week":"Wednesday","day_of_week_i":2,"email":"eddie@clayton-family.zzz","manufacturer":["Oceanavigations","Elitelligence"],"order_date":"2019-11-20T12:31:41+00:00","order_id":578044,"products":[{"base_price":22.99,"discount_percentage":0,"quantity":1,"manufacturer":"Oceanavigations","tax_amount":0,"product_id":22200,"category":"Men's Clothing","sku":"ZO0279602796","taxless_price":22.99,"unit_discount_amount":0,"min_price":11.72,"_id":"sold_product_578044_22200","discount_amount":0,"created_on":"2016-12-21T12:31:41+00:00","product_name":"Shirt - off white","price":22.99,"taxful_price":22.99,"base_unit_price":22.99},{"base_price":18.99,"discount_percentage":0,"quantity":1,"manufacturer":"Elitelligence","tax_amount":0,"product_id":20111,"category":"Women's Accessories","sku":"ZO0605006050","taxless_price":18.99,"unit_discount_amount":0,"min_price":9.12,"_id":"sold_product_578044_20111","discount_amount":0,"created_on":"2016-12-21T12:31:41+00:00","product_name":"Rucksack - black/cognac","price":18.99,"taxful_price":18.99,"base_unit_price":18.99}],"sku":["ZO0279602796","ZO0605006050"],"taxful_total_price":41.98,"taxless_total_price":41.98,"total_quantity":2,"total_unique_products":2,"type":"order","user":"eddie","geoip":{"country_iso_code":"EG","location":{"lon":31.3,"lat":30.1},"region_name":"Cairo Governorate","continent_name":"Africa","city_name":"Cairo"}}},{"_index":"kibana_sample_data_ecommerce","_type":"_doc","_id":"jHYbP24B9uEN4vPiBjaW","_score":4.016948,"_source":{"category":["Men's Accessories","Men's Clothing"],"currency":"EUR","customer_first_name":"Eddie","customer_full_name":"Eddie Riley","customer_gender":"MALE","customer_id":38,"customer_last_name":"Riley","customer_phone":"","day_of_week":"Sunday","day_of_week_i":6,"email":"eddie@riley-family.zzz","manufacturer":["Elitelligence","Microlutions"],"order_date":"2019-11-17T13:26:24+00:00","order_id":574129,"products":[{"base_price":24.99,"discount_percentage":0,"quantity":1,"manufacturer":"Elitelligence","tax_amount":0,"product_id":19430,"category":"Men's Accessories","sku":"ZO0606706067","taxless_price":24.99,"unit_discount_amount":0,"min_price":11.75,"_id":"sold_product_574129_19430","discount_amount":0,"created_on":"2016-12-18T13:26:24+00:00","product_name":"Across body bag - black","price":24.99,"taxful_price":24.99,"base_unit_price":24.99},{"base_price":14.99,"discount_percentage":0,"quantity":1,"manufacturer":"Microlutions","tax_amount":0,"product_id":18256,"category":"Men's Clothing","sku":"ZO0118301183","taxless_price":14.99,"unit_discount_amount":0,"min_price":8.09,"_id":"sold_product_574129_18256","discount_amount":0,"created_on":"2016-12-18T13:26:24+00:00","product_name":"Print T-shirt - bright white","price":14.99,"taxful_price":14.99,"base_unit_price":14.99}],"sku":["ZO0606706067","ZO0118301183"],"taxful_total_price":39.98,"taxless_total_price":39.98,"total_quantity":2,"total_unique_products":2,"type":"order","user":"eddie","geoip":{"country_iso_code":"EG","location":{"lon":31.3,"lat":30.1},"region_name":"Cairo Governorate","continent_name":"Africa","city_name":"Cairo"}}},{"_index":"kibana_sample_data_ecommerce","_type":"_doc","_id":"xXYbP24B9uEN4vPiBjaX","_score":4.016948,"_source":{"category":["Men's Shoes"],"currency":"EUR","customer_first_name":"Eddie","customer_full_name":"Eddie Garza","customer_gender":"MALE","customer_id":38,"customer_last_name":"Garza","customer_phone":"","day_of_week":"Friday","day_of_week_i":4,"email":"eddie@garza-family.zzz","manufacturer":["Angeldale","Low Tide Media"],"order_date":"2019-11-22T05:06:43+00:00","order_id":580284,"products":[{"base_price":84.99,"discount_percentage":0,"quantity":1,"manufacturer":"Angeldale","tax_amount":0,"product_id":2301,"category":"Men's Shoes","sku":"ZO0689906899","taxless_price":84.99,"unit_discount_amount":0,"min_price":42.49,"_id":"sold_product_580284_2301","discount_amount":0,"created_on":"2016-12-23T05:06:43+00:00","product_name":"Lace-up boots - Blue Violet","price":84.99,"taxful_price":84.99,"base_unit_price":84.99},{"base_price":49.99,"discount_percentage":0,"quantity":1,"manufacturer":"Low Tide Media","tax_amount":0,"product_id":13705,"category":"Men's Shoes","sku":"ZO0395903959","taxless_price":49.99,"unit_discount_amount":0,"min_price":25,"_id":"sold_product_580284_13705","discount_amount":0,"created_on":"2016-12-23T05:06:43+00:00","product_name":"Casual lace-ups - brown","price":49.99,"taxful_price":49.99,"base_unit_price":49.99}],"sku":["ZO0689906899","ZO0395903959"],"taxful_total_price":134.98,"taxless_total_price":134.98,"total_quantity":2,"total_unique_products":2,"type":"order","user":"eddie","geoip":{"country_iso_code":"EG","location":{"lon":31.3,"lat":30.1},"region_name":"Cairo Governorate","continent_name":"Africa","city_name":"Cairo"}}}]}} </pre> </div> <p> Request Body查询,方法支持get post -H包头 -d数据</p> <div> <pre>[root@ES ~]# curl -XGET "http://127.0.0.1:9200/kibana_sample_data_ecommerce/_search" -H 'Content-Type:application/json' -d' { "query":{ 查询 "match_all":{} 返回所有文档 } }' {"took":1,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":4675,"relation":"eq"},"max_score":1.0,"hits":[{"_index":"kibana_sample_data_ec ommerce","_type":"_doc","_id":"UXYbP24B9uEN4vPiBjWP","_score":1.0,"_source":{"category":["Men's Clothing"],"currency":"EUR","customer_first_name":"Eddie","customer_full_name":"Eddie Underwood","customer_gender":"MALE","customer_id":38,"customer_last_name":"Underwood","customer_phone":"","day_of_week":"Monday","day_of_week_i":0,"email":"eddie@underwood-family.zzz","manufacturer":["Elitelligence","Oceanavigations"],"order_date":"2019-11-25T09:28:48+00:00","order_id":584677,"products":[{"base_price":11.99,"discount_percentage":0,"quantity":1,"manufacturer":"Elitelligence","tax_amount":0,"product_id":6283,"category":"Men's Clothing","sku":"ZO0549605496","taxless_price":11.99,"unit_discount_amount":0,"min_price":6.35,"_id":"sold_product_584677_6283","discount_amount":0,"created_on":"2016-12-26T09:28:48+00:00","product_name":"Basic T-shirt - dark blue/white","price":11.99,"taxful_price":11.99,"base_unit_price":11.99},{"base_price":24.99,"discount_percentage":0,"quantity":1,"manufacturer":"Oceanavigations","tax_amount":0,"product_id":19400,"category":"Men's Clothing","sku":"ZO0299602996","taxless_price":24.99,"unit_discount_amount":0,"min_price":11.75,"_id":"sold_product_584677_19400","discount_amount":0,"created_on":"2016-12-26T09:28:48+00:00","product_name":"Sweatshirt - grey multicolor","price":24.99,"taxful_price":24.99,"base_unit_price":24.99}],"sku":["ZO0549605496","ZO0299602996"],"taxful_total_price":36.98,"taxless_total_price":36.98,"total_quantity":2,"total_unique_products":2,"type":"order","user":"eddie","geoip":{"country_iso_code":"EG","location":{"lon":31.3,"lat":30.1},"region_name":"Cairo Governorate","continent_name":"Africa","city_name":"Cairo"}}},{"_index":"kibana_sample_data_ecommerce","_type":"_doc","_id":"UnYbP24B9uEN4vPiBjWP","_score":1.0,"_source":{"category":["Women's Clothing"],"currency":"EUR","customer_first_name":"Mary","customer_full_name":"Mary Bailey","customer_gender":"FEMALE","customer_id":20,"customer_last_name":"Bailey","customer_phone":"","day_of_week":"Sunday","day_of_week_i":6,"email":"mary@bailey-family.zzz","manufacturer":["Champion Arts","Pyramidustries"],"order_date":"2019-11-24T21:59:02+00:00","order_id":584021,"products":[{"base_price":24.99,"discount_percentage":0,"quantity":1,"manufacturer":"Champion Arts","tax_amount":0,"product_id":11238,"category":"Women's Clothing","sku":"ZO0489604896","taxless_price":24.99,"unit_discount_amount":0,"min_price":11.75,"_id":"sold_product_584021_11238","discount_amount":0,"created_on":"2016-12-25T21:59:02+00:00","product_name":"Denim dress - black denim","price":24.99,"taxful_price":24.99,"base_unit_price":24.99},{"base_price":28.99,"discount_percentage":0,"quantity":1,"manufacturer":"Pyramidustries","tax_amount":0,"product_id":20149,"category":"Women's Clothing","sku":"ZO0185501855","taxless_price":28.99,"unit_discount_amount":0,"min_price":15.65,"_id":"sold_product_584021_20149","discount_amount":0,"created_on":"2016-12-25T21:59:02+00:00","product_name":"Shorts - black","price":28.99,"taxful_price":28.99,"base_unit_price":28.99}],"sku":["ZO0489604896","ZO0185501855"],"taxful_total_price":53.98,"taxless_total_price":53.98,"total_quantity":2,"total_unique_products":2,"type":"order","user":"mary","geoip":{"country_iso_code":"AE","location":{"lon":55.3,"lat":25.3},"region_name":"Dubai","continent_name":"Asia","city_name":"Dubai"}}},{"_index":"kibana_sample_data_ecommerce","_type":"_doc","_id":"U3YbP24B9uEN4vPiBjWP","_score":1.0,"_source":{"category":["Women's Shoes","Women's Clothing"],"currency":"EUR","customer_first_name":"Gwen","customer_full_name":"Gwen Butler","customer_gender":"FEMALE","customer_id":26,"customer_last_name":"Butler","customer_phone":"","day_of_week":"Sunday","day_of_week_i":6,"email":"gwen@butler-family.zzz","manufacturer":["Low Tide Media","Oceanavigations"],"order_date":"2019-11-24T22:32:10+00:00","order_id":584058,"products":[{"base_price":99.99,"discount_percentage":0,"quantity":1,"manufacturer":"Low Tide Media","tax_amount":0,"product_id":22794,"category":"Women's Shoes","sku":"ZO0374603746","taxless_price":99.99,"unit_discount_amount":0,"min_price":46,"_id":"sold_product_584058_22794","discount_amount":0,"created_on":"2016-12-25T22:32:10+00:00","product_name":"Boots - Midnight Blue","price":99.99,"taxful_price":99.99,"base_unit_price":99.99},{"base_price":99.99,"discount_percentage":0,"quantity":1,"manufacturer":"Oceanavigations","tax_amount":0,"product_id":23386,"category":"Women's Clothing","sku":"ZO0272202722","taxless_price":99.99,"unit_discount_amount":0,"min_price":53.99,"_id":"sold_product_584058_23386","discount_amount":0,"created_on":"2016-12-25T22:32:10+00:00","product_name":"Short coat - white/black","price":99.99,"taxful_price":99.99,"base_unit_price":99.99}],"sku":["ZO0374603746","ZO0272202722"],"taxful_total_price":199.98,"taxless_total_price":199.98,"total_quantity":2,"total_unique_products":2,"type":"order","user":"gwen","geoip":{"country_iso_code":"US","location":{"lon":-118.2,"lat":34.1},"region_name":"California","continent_name":"North America","city_name":"Los Angeles"}}},{"_index":"kibana_sample_data_ecommerce","_type":"_doc","_id":"VHYbP24B9uEN4vPiBjWP","_score":1.0,"_source":{"category":["Women's Shoes","Women's Clothing"],"currency":"EUR","customer_first_name":"Diane","customer_full_name":"Diane Chandler","customer_gender":"FEMALE","customer_id":22,"customer_last_name":"Chandler","customer_phone":"","day_of_week":"Sunday","day_of_week_i":6,"email":"diane@chandler-family.zzz","manufacturer":["Primemaster","Oceanavigations"],"order_date":"2019-11-24T22:58:05+00:00","order_id":584093,"products":[{"base_price":74.99,"discount_percentage":0,"quantity":1,"manufacturer":"Primemaster","tax_amount":0,"product_id":12304,"category":"Women's Shoes","sku":"ZO0360303603","taxless_price":74.99,"unit_discount_amount":0,"min_price":34.5,"_id":"sold_product_584093_12304","discount_amount":0,"created_on":"2016-12-25T22:58:05+00:00","product_name":"High heeled sandals - argento","price":74.99,"taxful_price":74.99,"base_unit_price":74.99},{"base_price":99.99,"discount_percentage":0,"quantity":1,"manufacturer":"Oceanavigations","tax_amount":0,"product_id":19587,"category":"Women's Clothing","sku":"ZO0272002720","taxless_price":99.99,"unit_discount_amount":0,"min_price":47,"_id":"sold_product_584093_19587","discount_amount":0,"created_on":"2016-12-25T22:58:05+00:00","product_name":"Classic coat - black","price":99.99,"taxful_price":99.99,"base_unit_price":99.99}],"sku":["ZO0360303603","ZO0272002720"],"taxful_total_price":174.98,"taxless_total_price":174.98,"total_quantity":2,"total_unique_products":2,"type":"order","user":"diane","geoip":{"country_iso_code":"GB","location":{"lon":-0.1,"lat":51.5},"continent_name":"Europe"}}},{"_index":"kibana_sample_data_ecommerce","_type":"_doc","_id":"VXYbP24B9uEN4vPiBjWP","_score":1.0,"_source":{"category":["Men's Clothing","Men's Accessories"],"currency":"EUR","customer_first_name":"Eddie","customer_full_name":"Eddie Weber","customer_gender":"MALE","customer_id":38,"customer_last_name":"Weber","customer_phone":"","day_of_week":"Monday","day_of_week_i":0,"email":"eddie@weber-family.zzz","manufacturer":["Elitelligence"],"order_date":"2019-11-18T03:48:58+00:00","order_id":574916,"products":[{"base_price":59.99,"discount_percentage":0,"quantity":1,"manufacturer":"Elitelligence","tax_amount":0,"product_id":11262,"category":"Men's Clothing","sku":"ZO0542505425","taxless_price":59.99,"unit_discount_amount":0,"min_price":28.2,"_id":"sold_product_574916_11262","discount_amount":0,"created_on":"2016-12-19T03:48:58+00:00","product_name":"Winter jacket - black","price":59.99,"taxful_price":59.99,"base_unit_price":59.99},{"base_price":20.99,"discount_percentage":0,"quantity":1,"manufacturer":"Elitelligence","tax_amount":0,"product_id":15713,"category":"Men's Accessories","sku":"ZO0601306013","taxless_price":20.99,"unit_discount_amount":0,"min_price":10.7,"_id":"sold_product_574916_15713","discount_amount":0,"created_on":"2016-12-19T03:48:58+00:00","product_name":"Watch - green","price":20.99,"taxful_price":20.99,"base_unit_price":20.99}],"sku":["ZO0542505425","ZO0601306013"],"taxful_total_price":80.98,"taxless_total_price":80.98,"total_quantity":2,"total_unique_products":2,"type":"order","user":"eddie","geoip":{"country_iso_code":"EG","location":{"lon":31.3,"lat":30.1},"region_name":"Cairo Governorate","continent_name":"Africa","city_name":"Cairo"}}},{"_index":"kibana_sample_data_ecommerce","_type":"_doc","_id":"VnYbP24B9uEN4vPiBjWP","_score":1.0,"_source":{"category":["Women's Shoes","Women's Clothing"],"currency":"EUR","customer_first_name":"Diane","customer_full_name":"Diane Goodwin","customer_gender":"FEMALE","customer_id":22,"customer_last_name":"Goodwin","customer_phone":"","day_of_week":"Sunday","day_of_week_i":6,"email":"diane@goodwin-family.zzz","manufacturer":["Low Tide Media","Pyramidustries"],"order_date":"2019-11-17T21:44:38+00:00","order_id":574586,"products":[{"base_price":59.99,"discount_percentage":0,"quantity":1,"manufacturer":"Low Tide Media","tax_amount":0,"product_id":5419,"category":"Women's Shoes","sku":"ZO0376303763","taxless_price":59.99,"unit_discount_amount":0,"min_price":31.79,"_id":"sold_product_574586_5419","discount_amount":0,"created_on":"2016-12-18T21:44:38+00:00","product_name":"Winter boots - brown","price":59.99,"taxful_price":59.99,"base_unit_price":59.99},{"base_price":11.99,"discount_percentage":0,"quantity":1,"manufacturer":"Pyramidustries","tax_amount":0,"product_id":19325,"category":"Women's Clothing","sku":"ZO0212402124","taxless_price":11.99,"unit_discount_amount":0,"min_price":6.47,"_id":"sold_product_574586_19325","discount_amount":0,"created_on":"2016-12-18T21:44:38+00:00","product_name":"Shorts - dark blue/pink/dark green","price":11.99,"taxful_price":11.99,"base_unit_price":11.99}],"sku":["ZO0376303763","ZO0212402124"],"taxful_total_price":71.98,"taxless_total_price":71.98,"total_quantity":2,"total_unique_products":2,"type":"order","user":"diane","geoip":{"country_iso_code":"GB","location":{"lon":-0.1,"lat":51.5},"continent_name":"Europe"}}},{"_index":"kibana_sample_data_ecommerce","_type":"_doc","_id":"V3YbP24B9uEN4vPiBjWP","_score":1.0,"_source":{"category":["Men's Clothing"],"currency":"EUR","customer_first_name":"Oliver","customer_full_name":"Oliver Rios","customer_gender":"MALE","customer_id":7,"customer_last_name":"Rios","customer_phone":"","day_of_week":"Monday","day_of_week_i":0,"email":"oliver@rios-family.zzz","manufacturer":["Low Tide Media","Elitelligence"],"order_date":"2019-11-11T09:27:22+00:00","order_id":565855,"products":[{"base_price":20.99,"discount_percentage":0,"quantity":1,"manufacturer":"Low Tide Media","tax_amount":0,"product_id":19919,"category":"Men's Clothing","sku":"ZO0417504175","taxless_price":20.99,"unit_discount_amount":0,"min_price":9.87,"_id":"sold_product_565855_19919","discount_amount":0,"created_on":"2016-12-12T09:27:22+00:00","product_name":"Shirt - dark blue white","price":20.99,"taxful_price":20.99,"base_unit_price":20.99},{"base_price":24.99,"discount_percentage":0,"quantity":1,"manufacturer":"Elitelligence","tax_amount":0,"product_id":24502,"category":"Men's Clothing","sku":"ZO0535205352","taxless_price":24.99,"unit_discount_amount":0,"min_price":12.49,"_id":"sold_product_565855_24502","discount_amount":0,"created_on":"2016-12-12T09:27:22+00:00","product_name":"Slim fit jeans - raw blue","price":24.99,"taxful_price":24.99,"base_unit_price":24.99}],"sku":["ZO0417504175","ZO0535205352"],"taxful_total_price":45.98,"taxless_total_price":45.98,"total_quantity":2,"total_unique_products":2,"type":"order","user":"oliver","geoip":{"country_iso_code":"GB","location":{"lon":-0.1,"lat":51.5},"continent_name":"Europe"}}},{"_index":"kibana_sample_data_ecommerce","_type":"_doc","_id":"WHYbP24B9uEN4vPiBjWQ","_score":1.0,"_source":{"category":["Men's Clothing","Men's Accessories","Men's Shoes"],"currency":"EUR","customer_first_name":"Abd","customer_full_name":"Abd Sutton","customer_gender":"MALE","customer_id":52,"customer_last_name":"Sutton","customer_phone":"","day_of_week":"Monday","day_of_week_i":0,"email":"abd@sutton-family.zzz","manufacturer":["Low Tide Media","Oceanavigations","Elitelligence"],"order_date":"2019-11-25T02:19:41+00:00","order_id":723055,"products":[{"base_price":28.99,"discount_percentage":0,"quantity":1,"manufacturer":"Low Tide Media","tax_amount":0,"product_id":11751,"category":"Men's Clothing","sku":"ZO0423104231","taxless_price":28.99,"unit_discount_amount":0,"min_price":14.78,"_id":"sold_product_723055_11751","discount_amount":0,"created_on":"2016-12-26T02:19:41+00:00","product_name":"Shorts - beige","price":28.99,"taxful_price":28.99,"base_unit_price":28.99},{"base_price":41.99,"discount_percentage":0,"quantity":1,"manufacturer":"Oceanavigations","tax_amount":0,"product_id":13452,"category":"Men's Accessories","sku":"ZO0314203142","taxless_price":41.99,"unit_discount_amount":0,"min_price":20.58,"_id":"sold_product_723055_13452","discount_amount":0,"created_on":"2016-12-26T02:19:41+00:00","product_name":"Weekend bag - black","price":41.99,"taxful_price":41.99,"base_unit_price":41.99},{"base_price":59.99,"discount_percentage":0,"quantity":1,"manufacturer":"Low Tide Media","tax_amount":0,"product_id":22434,"category":"Men's Shoes","sku":"ZO0394403944","taxless_price":59.99,"unit_discount_amount":0,"min_price":30,"_id":"sold_product_723055_22434","discount_amount":0,"created_on":"2016-12-26T02:19:41+00:00","product_name":"Casual lace-ups - cognac","price":59.99,"taxful_price":59.99,"base_unit_price":59.99},{"base_price":7.99,"discount_percentage":0,"quantity":1,"manufacturer":"Elitelligence","tax_amount":0,"product_id":7059,"category":"Men's Clothing","sku":"ZO0561805618","taxless_price":7.99,"unit_discount_amount":0,"min_price":3.76,"_id":"sold_product_723055_7059","discount_amount":0,"created_on":"2016-12-26T02:19:41+00:00","product_name":"Print T-shirt - off white/green","price":7.99,"taxful_price":7.99,"base_unit_price":7.99}],"sku":["ZO0423104231","ZO0314203142","ZO0394403944","ZO0561805618"],"taxful_total_price":138.96,"taxless_total_price":138.96,"total_quantity":4,"total_unique_products":4,"type":"order","user":"abd","geoip":{"country_iso_code":"EG","location":{"lon":31.3,"lat":30.1},"region_name":"Cairo Governorate","continent_name":"Africa","city_name":"Cairo"}}},{"_index":"kibana_sample_data_ecommerce","_type":"_doc","_id":"WXYbP24B9uEN4vPiBjWQ","_score":1.0,"_source":{"category":["Women's Accessories","Women's Clothing"],"currency":"EUR","customer_first_name":"Wilhemina St.","customer_full_name":"Wilhemina St. Tran","customer_gender":"FEMALE","customer_id":17,"customer_last_name":"Tran","customer_phone":"","day_of_week":"Sunday","day_of_week_i":6,"email":"wilhemina st.@tran-family.zzz","manufacturer":["Pyramidustries","Tigress Enterprises","Pyramidustries active","Oceanavigations"],"order_date":"2019-11-17T00:59:02+00:00","order_id":727462,"products":[{"base_price":8.99,"discount_percentage":0,"quantity":1,"manufacturer":"Pyramidustries","tax_amount":0,"product_id":12012,"category":"Women's Accessories","sku":"ZO0186801868","taxless_price":8.99,"unit_discount_amount":0,"min_price":4.14,"_id":"sold_product_727462_12012","discount_amount":0,"created_on":"2016-12-18T00:59:02+00:00","product_name":"Mittens - grey","price":8.99,"taxful_price":8.99,"base_unit_price":8.99},{"base_price":20.99,"discount_percentage":0,"quantity":1,"manufacturer":"Tigress Enterprises","tax_amount":0,"product_id":16471,"category":"Women's Clothing","sku":"ZO0074100741","taxless_price":20.99,"unit_discount_amount":0,"min_price":9.66,"_id":"sold_product_727462_16471","discount_amount":0,"created_on":"2016-12-18T00:59:02+00:00","product_name":"Vest - black/Chocolate","price":20.99,"taxful_price":20.99,"base_unit_price":20.99},{"base_price":16.99,"discount_percentage":0,"quantity":1,"manufacturer":"Pyramidustries active","tax_amount":0,"product_id":10554,"category":"Women's Clothing","sku":"ZO0223202232","taxless_price":16.99,"unit_discount_amount":0,"min_price":7.82,"_id":"sold_product_727462_10554","discount_amount":0,"created_on":"2016-12-18T00:59:02+00:00","product_name":"Tracksuit bottoms - Pale Violet Red","price":16.99,"taxful_price":16.99,"base_unit_price":16.99},{"base_price":41.99,"discount_percentage":0,"quantity":1,"manufacturer":"Oceanavigations","tax_amount":0,"product_id":22882,"category":"Women's Clothing","sku":"ZO0267602676","taxless_price":41.99,"unit_discount_amount":0,"min_price":23.09,"_id":"sold_product_727462_22882","discount_amount":0,"created_on":"2016-12-18T00:59:02+00:00","product_name":"Cardigan - black","price":41.99,"taxful_price":41.99,"base_unit_price":41.99}],"sku":["ZO0186801868","ZO0074100741","ZO0223202232","ZO0267602676"],"taxful_total_price":88.96,"taxless_total_price":88.96,"total_quantity":4,"total_unique_products":4,"type":"order","user":"wilhemina","geoip":{"country_iso_code":"MC","location":{"lon":7.4,"lat":43.7},"continent_name":"Europe","city_name":"Monte Carlo"}}},{"_index":"kibana_sample_data_ecommerce","_type":"_doc","_id":"WnYbP24B9uEN4vPiBjWQ","_score":1.0,"_source":{"category":["Women's Shoes","Women's Clothing"],"currency":"EUR","customer_first_name":"Rabbia Al","customer_full_name":"Rabbia Al Baker","customer_gender":"FEMALE","customer_id":5,"customer_last_name":"Baker","customer_phone":"","day_of_week":"Monday","day_of_week_i":0,"email":"rabbia al@baker-family.zzz","manufacturer":["Oceanavigations","Tigress Enterprises","Champion Arts","Pyramidustries"],"order_date":"2019-11-25T03:41:46+00:00","order_id":727269,"products":[{"base_price":74.99,"discount_percentage":0,"quantity":1,"manufacturer":"Oceanavigations","tax_amount":0,"product_id":22880,"category":"Women's Shoes","sku":"ZO0249902499","taxless_price":74.99,"unit_discount_amount":0,"min_price":35.25,"_id":"sold_product_727269_22880","discount_amount":0,"created_on":"2016-12-26T03:41:46+00:00","product_name":"Boots - black","price":74.99,"taxful_price":74.99,"base_unit_price":74.99},{"base_price":32.99,"discount_percentage":0,"quantity":1,"manufacturer":"Tigress Enterprises","tax_amount":0,"product_id":12484,"category":"Women's Clothing","sku":"ZO0068400684","taxless_price":32.99,"unit_discount_amount":0,"min_price":17.48,"_id":"sold_product_727269_12484","discount_amount":0,"created_on":"2016-12-26T03:41:46+00:00","product_name":"Cardigan - black/white","price":32.99,"taxful_price":32.99,"base_unit_price":32.99},{"base_price":13.99,"discount_percentage":0,"quantity":1,"manufacturer":"Champion Arts","tax_amount":0,"product_id":21362,"category":"Women's Clothing","sku":"ZO0494704947","taxless_price":13.99,"unit_discount_amount":0,"min_price":6.58,"_id":"sold_product_727269_21362","discount_amount":0,"created_on":"2016-12-26T03:41:46+00:00","product_name":"Long sleeved top - blue","price":13.99,"taxful_price":13.99,"base_unit_price":13.99},{"base_price":49.99,"discount_percentage":0,"quantity":1,"manufacturer":"Pyramidustries","tax_amount":0,"product_id":13854,"category":"Women's Shoes","sku":"ZO0143401434","taxless_price":49.99,"unit_discount_amount":0,"min_price":25.49,"_id":"sold_product_727269_13854","discount_amount":0,"created_on":"2016-12-26T03:41:46+00:00","product_name":"Lace-up boots - black","price":49.99,"taxful_price":49.99,"base_unit_price":49.99}],"sku":["ZO0249902499","ZO0068400684","ZO0494704947","ZO0143401434"],"taxful_total_price":171.96,"taxless_total_price":171.96,"total_quantity":4,"total_unique_products":4,"type":"order","user":"rabbia","geoip":{"country_iso_code":"AE","location":{"lon":55.3,"lat":25.3},"region_name":"Dubai","continent_name":"Asia","city_name":"Dubai"}}}]}} </pre> </div> <p>  kibana 上查询</p> <div> <pre>POST kibana_sample_data_ecommerce/_search { "query":{ "match_all":{} } } { "took" : 2, 花费的时间 "timed_out" : false, "_shards" : { "total" : 1, "successful" : 1, "skipped" : 0, "failed" : 0 }, "hits" : { "total" : { "value" : 4675, 符合条件的总文档数 "relation" : "eq" }, "max_score" : 1.0, "hits" : [ 结果集,默认前10个 { "_index" : "kibana_sample_data_ecommerce", 索引名 "_type" : "_doc", "_id" : "UXYbP24B9uEN4vPiBjWP", ID "_score" : 1.0, 相关度评分 "_source" : { 文档原始数据 "category" : [ "Men's Clothing" ], "currency" : "EUR", "customer_first_name" : "Eddie", "customer_full_name" : "Eddie Underwood", "customer_gender" : "MALE", "customer_id" : 38, "customer_last_name" : "Underwood", "customer_phone" : "", "day_of_week" : "Monday", "day_of_week_i" : 0, "email" : "eddie@underwood-family.zzz", "manufacturer" : [ "Elitelligence", "Oceanavigations" ], "order_date" : "2019-11-25T09:28:48+00:00", "order_id" : 584677, "products" : [ { "base_price" : 11.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Elitelligence", "tax_amount" : 0, "product_id" : 6283, "category" : "Men's Clothing", "sku" : "ZO0549605496", "taxless_price" : 11.99, "unit_discount_amount" : 0, "min_price" : 6.35, "_id" : "sold_product_584677_6283", "discount_amount" : 0, "created_on" : "2016-12-26T09:28:48+00:00", "product_name" : "Basic T-shirt - dark blue/white", "price" : 11.99, "taxful_price" : 11.99, "base_unit_price" : 11.99 }, { "base_price" : 24.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Oceanavigations", "tax_amount" : 0, "product_id" : 19400, "category" : "Men's Clothing", "sku" : "ZO0299602996", "taxless_price" : 24.99, "unit_discount_amount" : 0, "min_price" : 11.75, "_id" : "sold_product_584677_19400", "discount_amount" : 0, "created_on" : "2016-12-26T09:28:48+00:00", "product_name" : "Sweatshirt - grey multicolor", "price" : 24.99, "taxful_price" : 24.99, "base_unit_price" : 24.99 } ], "sku" : [ "ZO0549605496", "ZO0299602996" ], "taxful_total_price" : 36.98, "taxless_total_price" : 36.98, "total_quantity" : 2, "total_unique_products" : 2, "type" : "order", "user" : "eddie", "geoip" : { "country_iso_code" : "EG", "location" : { "lon" : 31.3, "lat" : 30.1 }, "region_name" : "Cairo Governorate", "continent_name" : "Africa", "city_name" : "Cairo" } } }, { "_index" : "kibana_sample_data_ecommerce", "_type" : "_doc", "_id" : "UnYbP24B9uEN4vPiBjWP", "_score" : 1.0, "_source" : { "category" : [ "Women's Clothing" ], "currency" : "EUR", "customer_first_name" : "Mary", "customer_full_name" : "Mary Bailey", "customer_gender" : "FEMALE", "customer_id" : 20, "customer_last_name" : "Bailey", "customer_phone" : "", "day_of_week" : "Sunday", "day_of_week_i" : 6, "email" : "mary@bailey-family.zzz", "manufacturer" : [ "Champion Arts", "Pyramidustries" ], "order_date" : "2019-11-24T21:59:02+00:00", "order_id" : 584021, "products" : [ { "base_price" : 24.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Champion Arts", "tax_amount" : 0, "product_id" : 11238, "category" : "Women's Clothing", "sku" : "ZO0489604896", "taxless_price" : 24.99, "unit_discount_amount" : 0, "min_price" : 11.75, "_id" : "sold_product_584021_11238", "discount_amount" : 0, "created_on" : "2016-12-25T21:59:02+00:00", "product_name" : "Denim dress - black denim", "price" : 24.99, "taxful_price" : 24.99, "base_unit_price" : 24.99 }, { "base_price" : 28.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Pyramidustries", "tax_amount" : 0, "product_id" : 20149, "category" : "Women's Clothing", "sku" : "ZO0185501855", "taxless_price" : 28.99, "unit_discount_amount" : 0, "min_price" : 15.65, "_id" : "sold_product_584021_20149", "discount_amount" : 0, "created_on" : "2016-12-25T21:59:02+00:00", "product_name" : "Shorts - black", "price" : 28.99, "taxful_price" : 28.99, "base_unit_price" : 28.99 } ], "sku" : [ "ZO0489604896", "ZO0185501855" ], "taxful_total_price" : 53.98, "taxless_total_price" : 53.98, "total_quantity" : 2, "total_unique_products" : 2, "type" : "order", "user" : "mary", "geoip" : { "country_iso_code" : "AE", "location" : { "lon" : 55.3, "lat" : 25.3 }, "region_name" : "Dubai", "continent_name" : "Asia", "city_name" : "Dubai" } } }, { "_index" : "kibana_sample_data_ecommerce", "_type" : "_doc", "_id" : "U3YbP24B9uEN4vPiBjWP", "_score" : 1.0, "_source" : { "category" : [ "Women's Shoes", "Women's Clothing" ], "currency" : "EUR", "customer_first_name" : "Gwen", "customer_full_name" : "Gwen Butler", "customer_gender" : "FEMALE", "customer_id" : 26, "customer_last_name" : "Butler", "customer_phone" : "", "day_of_week" : "Sunday", "day_of_week_i" : 6, "email" : "gwen@butler-family.zzz", "manufacturer" : [ "Low Tide Media", "Oceanavigations" ], "order_date" : "2019-11-24T22:32:10+00:00", "order_id" : 584058, "products" : [ { "base_price" : 99.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Low Tide Media", "tax_amount" : 0, "product_id" : 22794, "category" : "Women's Shoes", "sku" : "ZO0374603746", "taxless_price" : 99.99, "unit_discount_amount" : 0, "min_price" : 46, "_id" : "sold_product_584058_22794", "discount_amount" : 0, "created_on" : "2016-12-25T22:32:10+00:00", "product_name" : "Boots - Midnight Blue", "price" : 99.99, "taxful_price" : 99.99, "base_unit_price" : 99.99 }, { "base_price" : 99.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Oceanavigations", "tax_amount" : 0, "product_id" : 23386, "category" : "Women's Clothing", "sku" : "ZO0272202722", "taxless_price" : 99.99, "unit_discount_amount" : 0, "min_price" : 53.99, "_id" : "sold_product_584058_23386", "discount_amount" : 0, "created_on" : "2016-12-25T22:32:10+00:00", "product_name" : "Short coat - white/black", "price" : 99.99, "taxful_price" : 99.99, "base_unit_price" : 99.99 } ], "sku" : [ "ZO0374603746", "ZO0272202722" ], "taxful_total_price" : 199.98, "taxless_total_price" : 199.98, "total_quantity" : 2, "total_unique_products" : 2, "type" : "order", "user" : "gwen", "geoip" : { "country_iso_code" : "US", "location" : { "lon" : -118.2, "lat" : 34.1 }, "region_name" : "California", "continent_name" : "North America", "city_name" : "Los Angeles" } } }, { "_index" : "kibana_sample_data_ecommerce", "_type" : "_doc", "_id" : "VHYbP24B9uEN4vPiBjWP", "_score" : 1.0, "_source" : { "category" : [ "Women's Shoes", "Women's Clothing" ], "currency" : "EUR", "customer_first_name" : "Diane", "customer_full_name" : "Diane Chandler", "customer_gender" : "FEMALE", "customer_id" : 22, "customer_last_name" : "Chandler", "customer_phone" : "", "day_of_week" : "Sunday", "day_of_week_i" : 6, "email" : "diane@chandler-family.zzz", "manufacturer" : [ "Primemaster", "Oceanavigations" ], "order_date" : "2019-11-24T22:58:05+00:00", "order_id" : 584093, "products" : [ { "base_price" : 74.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Primemaster", "tax_amount" : 0, "product_id" : 12304, "category" : "Women's Shoes", "sku" : "ZO0360303603", "taxless_price" : 74.99, "unit_discount_amount" : 0, "min_price" : 34.5, "_id" : "sold_product_584093_12304", "discount_amount" : 0, "created_on" : "2016-12-25T22:58:05+00:00", "product_name" : "High heeled sandals - argento", "price" : 74.99, "taxful_price" : 74.99, "base_unit_price" : 74.99 }, { "base_price" : 99.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Oceanavigations", "tax_amount" : 0, "product_id" : 19587, "category" : "Women's Clothing", "sku" : "ZO0272002720", "taxless_price" : 99.99, "unit_discount_amount" : 0, "min_price" : 47, "_id" : "sold_product_584093_19587", "discount_amount" : 0, "created_on" : "2016-12-25T22:58:05+00:00", "product_name" : "Classic coat - black", "price" : 99.99, "taxful_price" : 99.99, "base_unit_price" : 99.99 } ], "sku" : [ "ZO0360303603", "ZO0272002720" ], "taxful_total_price" : 174.98, "taxless_total_price" : 174.98, "total_quantity" : 2, "total_unique_products" : 2, "type" : "order", "user" : "diane", "geoip" : { "country_iso_code" : "GB", "location" : { "lon" : -0.1, "lat" : 51.5 }, "continent_name" : "Europe" } } }, { "_index" : "kibana_sample_data_ecommerce", "_type" : "_doc", "_id" : "VXYbP24B9uEN4vPiBjWP", "_score" : 1.0, "_source" : { "category" : [ "Men's Clothing", "Men's Accessories" ], "currency" : "EUR", "customer_first_name" : "Eddie", "customer_full_name" : "Eddie Weber", "customer_gender" : "MALE", "customer_id" : 38, "customer_last_name" : "Weber", "customer_phone" : "", "day_of_week" : "Monday", "day_of_week_i" : 0, "email" : "eddie@weber-family.zzz", "manufacturer" : [ "Elitelligence" ], "order_date" : "2019-11-18T03:48:58+00:00", "order_id" : 574916, "products" : [ { "base_price" : 59.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Elitelligence", "tax_amount" : 0, "product_id" : 11262, "category" : "Men's Clothing", "sku" : "ZO0542505425", "taxless_price" : 59.99, "unit_discount_amount" : 0, "min_price" : 28.2, "_id" : "sold_product_574916_11262", "discount_amount" : 0, "created_on" : "2016-12-19T03:48:58+00:00", "product_name" : "Winter jacket - black", "price" : 59.99, "taxful_price" : 59.99, "base_unit_price" : 59.99 }, { "base_price" : 20.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Elitelligence", "tax_amount" : 0, "product_id" : 15713, "category" : "Men's Accessories", "sku" : "ZO0601306013", "taxless_price" : 20.99, "unit_discount_amount" : 0, "min_price" : 10.7, "_id" : "sold_product_574916_15713", "discount_amount" : 0, "created_on" : "2016-12-19T03:48:58+00:00", "product_name" : "Watch - green", "price" : 20.99, "taxful_price" : 20.99, "base_unit_price" : 20.99 } ], "sku" : [ "ZO0542505425", "ZO0601306013" ], "taxful_total_price" : 80.98, "taxless_total_price" : 80.98, "total_quantity" : 2, "total_unique_products" : 2, "type" : "order", "user" : "eddie", "geoip" : { "country_iso_code" : "EG", "location" : { "lon" : 31.3, "lat" : 30.1 }, "region_name" : "Cairo Governorate", "continent_name" : "Africa", "city_name" : "Cairo" } } }, { "_index" : "kibana_sample_data_ecommerce", "_type" : "_doc", "_id" : "VnYbP24B9uEN4vPiBjWP", "_score" : 1.0, "_source" : { "category" : [ "Women's Shoes", "Women's Clothing" ], "currency" : "EUR", "customer_first_name" : "Diane", "customer_full_name" : "Diane Goodwin", "customer_gender" : "FEMALE", "customer_id" : 22, "customer_last_name" : "Goodwin", "customer_phone" : "", "day_of_week" : "Sunday", "day_of_week_i" : 6, "email" : "diane@goodwin-family.zzz", "manufacturer" : [ "Low Tide Media", "Pyramidustries" ], "order_date" : "2019-11-17T21:44:38+00:00", "order_id" : 574586, "products" : [ { "base_price" : 59.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Low Tide Media", "tax_amount" : 0, "product_id" : 5419, "category" : "Women's Shoes", "sku" : "ZO0376303763", "taxless_price" : 59.99, "unit_discount_amount" : 0, "min_price" : 31.79, "_id" : "sold_product_574586_5419", "discount_amount" : 0, "created_on" : "2016-12-18T21:44:38+00:00", "product_name" : "Winter boots - brown", "price" : 59.99, "taxful_price" : 59.99, "base_unit_price" : 59.99 }, { "base_price" : 11.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Pyramidustries", "tax_amount" : 0, "product_id" : 19325, "category" : "Women's Clothing", "sku" : "ZO0212402124", "taxless_price" : 11.99, "unit_discount_amount" : 0, "min_price" : 6.47, "_id" : "sold_product_574586_19325", "discount_amount" : 0, "created_on" : "2016-12-18T21:44:38+00:00", "product_name" : "Shorts - dark blue/pink/dark green", "price" : 11.99, "taxful_price" : 11.99, "base_unit_price" : 11.99 } ], "sku" : [ "ZO0376303763", "ZO0212402124" ], "taxful_total_price" : 71.98, "taxless_total_price" : 71.98, "total_quantity" : 2, "total_unique_products" : 2, "type" : "order", "user" : "diane", "geoip" : { "country_iso_code" : "GB", "location" : { "lon" : -0.1, "lat" : 51.5 }, "continent_name" : "Europe" } } }, { "_index" : "kibana_sample_data_ecommerce", "_type" : "_doc", "_id" : "V3YbP24B9uEN4vPiBjWP", "_score" : 1.0, "_source" : { "category" : [ "Men's Clothing" ], "currency" : "EUR", "customer_first_name" : "Oliver", "customer_full_name" : "Oliver Rios", "customer_gender" : "MALE", "customer_id" : 7, "customer_last_name" : "Rios", "customer_phone" : "", "day_of_week" : "Monday", "day_of_week_i" : 0, "email" : "oliver@rios-family.zzz", "manufacturer" : [ "Low Tide Media", "Elitelligence" ], "order_date" : "2019-11-11T09:27:22+00:00", "order_id" : 565855, "products" : [ { "base_price" : 20.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Low Tide Media", "tax_amount" : 0, "product_id" : 19919, "category" : "Men's Clothing", "sku" : "ZO0417504175", "taxless_price" : 20.99, "unit_discount_amount" : 0, "min_price" : 9.87, "_id" : "sold_product_565855_19919", "discount_amount" : 0, "created_on" : "2016-12-12T09:27:22+00:00", "product_name" : "Shirt - dark blue white", "price" : 20.99, "taxful_price" : 20.99, "base_unit_price" : 20.99 }, { "base_price" : 24.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Elitelligence", "tax_amount" : 0, "product_id" : 24502, "category" : "Men's Clothing", "sku" : "ZO0535205352", "taxless_price" : 24.99, "unit_discount_amount" : 0, "min_price" : 12.49, "_id" : "sold_product_565855_24502", "discount_amount" : 0, "created_on" : "2016-12-12T09:27:22+00:00", "product_name" : "Slim fit jeans - raw blue", "price" : 24.99, "taxful_price" : 24.99, "base_unit_price" : 24.99 } ], "sku" : [ "ZO0417504175", "ZO0535205352" ], "taxful_total_price" : 45.98, "taxless_total_price" : 45.98, "total_quantity" : 2, "total_unique_products" : 2, "type" : "order", "user" : "oliver", "geoip" : { "country_iso_code" : "GB", "location" : { "lon" : -0.1, "lat" : 51.5 }, "continent_name" : "Europe" } } }, { "_index" : "kibana_sample_data_ecommerce", "_type" : "_doc", "_id" : "WHYbP24B9uEN4vPiBjWQ", "_score" : 1.0, "_source" : { "category" : [ "Men's Clothing", "Men's Accessories", "Men's Shoes" ], "currency" : "EUR", "customer_first_name" : "Abd", "customer_full_name" : "Abd Sutton", "customer_gender" : "MALE", "customer_id" : 52, "customer_last_name" : "Sutton", "customer_phone" : "", "day_of_week" : "Monday", "day_of_week_i" : 0, "email" : "abd@sutton-family.zzz", "manufacturer" : [ "Low Tide Media", "Oceanavigations", "Elitelligence" ], "order_date" : "2019-11-25T02:19:41+00:00", "order_id" : 723055, "products" : [ { "base_price" : 28.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Low Tide Media", "tax_amount" : 0, "product_id" : 11751, "category" : "Men's Clothing", "sku" : "ZO0423104231", "taxless_price" : 28.99, "unit_discount_amount" : 0, "min_price" : 14.78, "_id" : "sold_product_723055_11751", "discount_amount" : 0, "created_on" : "2016-12-26T02:19:41+00:00", "product_name" : "Shorts - beige", "price" : 28.99, "taxful_price" : 28.99, "base_unit_price" : 28.99 }, { "base_price" : 41.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Oceanavigations", "tax_amount" : 0, "product_id" : 13452, "category" : "Men's Accessories", "sku" : "ZO0314203142", "taxless_price" : 41.99, "unit_discount_amount" : 0, "min_price" : 20.58, "_id" : "sold_product_723055_13452", "discount_amount" : 0, "created_on" : "2016-12-26T02:19:41+00:00", "product_name" : "Weekend bag - black", "price" : 41.99, "taxful_price" : 41.99, "base_unit_price" : 41.99 }, { "base_price" : 59.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Low Tide Media", "tax_amount" : 0, "product_id" : 22434, "category" : "Men's Shoes", "sku" : "ZO0394403944", "taxless_price" : 59.99, "unit_discount_amount" : 0, "min_price" : 30, "_id" : "sold_product_723055_22434", "discount_amount" : 0, "created_on" : "2016-12-26T02:19:41+00:00", "product_name" : "Casual lace-ups - cognac", "price" : 59.99, "taxful_price" : 59.99, "base_unit_price" : 59.99 }, { "base_price" : 7.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Elitelligence", "tax_amount" : 0, "product_id" : 7059, "category" : "Men's Clothing", "sku" : "ZO0561805618", "taxless_price" : 7.99, "unit_discount_amount" : 0, "min_price" : 3.76, "_id" : "sold_product_723055_7059", "discount_amount" : 0, "created_on" : "2016-12-26T02:19:41+00:00", "product_name" : "Print T-shirt - off white/green", "price" : 7.99, "taxful_price" : 7.99, "base_unit_price" : 7.99 } ], "sku" : [ "ZO0423104231", "ZO0314203142", "ZO0394403944", "ZO0561805618" ], "taxful_total_price" : 138.96, "taxless_total_price" : 138.96, "total_quantity" : 4, "total_unique_products" : 4, "type" : "order", "user" : "abd", "geoip" : { "country_iso_code" : "EG", "location" : { "lon" : 31.3, "lat" : 30.1 }, "region_name" : "Cairo Governorate", "continent_name" : "Africa", "city_name" : "Cairo" } } }, { "_index" : "kibana_sample_data_ecommerce", "_type" : "_doc", "_id" : "WXYbP24B9uEN4vPiBjWQ", "_score" : 1.0, "_source" : { "category" : [ "Women's Accessories", "Women's Clothing" ], "currency" : "EUR", "customer_first_name" : "Wilhemina St.", "customer_full_name" : "Wilhemina St. Tran", "customer_gender" : "FEMALE", "customer_id" : 17, "customer_last_name" : "Tran", "customer_phone" : "", "day_of_week" : "Sunday", "day_of_week_i" : 6, "email" : "wilhemina st.@tran-family.zzz", "manufacturer" : [ "Pyramidustries", "Tigress Enterprises", "Pyramidustries active", "Oceanavigations" ], "order_date" : "2019-11-17T00:59:02+00:00", "order_id" : 727462, "products" : [ { "base_price" : 8.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Pyramidustries", "tax_amount" : 0, "product_id" : 12012, "category" : "Women's Accessories", "sku" : "ZO0186801868", "taxless_price" : 8.99, "unit_discount_amount" : 0, "min_price" : 4.14, "_id" : "sold_product_727462_12012", "discount_amount" : 0, "created_on" : "2016-12-18T00:59:02+00:00", "product_name" : "Mittens - grey", "price" : 8.99, "taxful_price" : 8.99, "base_unit_price" : 8.99 }, { "base_price" : 20.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Tigress Enterprises", "tax_amount" : 0, "product_id" : 16471, "category" : "Women's Clothing", "sku" : "ZO0074100741", "taxless_price" : 20.99, "unit_discount_amount" : 0, "min_price" : 9.66, "_id" : "sold_product_727462_16471", "discount_amount" : 0, "created_on" : "2016-12-18T00:59:02+00:00", "product_name" : "Vest - black/Chocolate", "price" : 20.99, "taxful_price" : 20.99, "base_unit_price" : 20.99 }, { "base_price" : 16.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Pyramidustries active", "tax_amount" : 0, "product_id" : 10554, "category" : "Women's Clothing", "sku" : "ZO0223202232", "taxless_price" : 16.99, "unit_discount_amount" : 0, "min_price" : 7.82, "_id" : "sold_product_727462_10554", "discount_amount" : 0, "created_on" : "2016-12-18T00:59:02+00:00", "product_name" : "Tracksuit bottoms - Pale Violet Red", "price" : 16.99, "taxful_price" : 16.99, "base_unit_price" : 16.99 }, { "base_price" : 41.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Oceanavigations", "tax_amount" : 0, "product_id" : 22882, "category" : "Women's Clothing", "sku" : "ZO0267602676", "taxless_price" : 41.99, "unit_discount_amount" : 0, "min_price" : 23.09, "_id" : "sold_product_727462_22882", "discount_amount" : 0, "created_on" : "2016-12-18T00:59:02+00:00", "product_name" : "Cardigan - black", "price" : 41.99, "taxful_price" : 41.99, "base_unit_price" : 41.99 } ], "sku" : [ "ZO0186801868", "ZO0074100741", "ZO0223202232", "ZO0267602676" ], "taxful_total_price" : 88.96, "taxless_total_price" : 88.96, "total_quantity" : 4, "total_unique_products" : 4, "type" : "order", "user" : "wilhemina", "geoip" : { "country_iso_code" : "MC", "location" : { "lon" : 7.4, "lat" : 43.7 }, "continent_name" : "Europe", "city_name" : "Monte Carlo" } } }, { "_index" : "kibana_sample_data_ecommerce", "_type" : "_doc", "_id" : "WnYbP24B9uEN4vPiBjWQ", "_score" : 1.0, "_source" : { "category" : [ "Women's Shoes", "Women's Clothing" ], "currency" : "EUR", "customer_first_name" : "Rabbia Al", "customer_full_name" : "Rabbia Al Baker", "customer_gender" : "FEMALE", "customer_id" : 5, "customer_last_name" : "Baker", "customer_phone" : "", "day_of_week" : "Monday", "day_of_week_i" : 0, "email" : "rabbia al@baker-family.zzz", "manufacturer" : [ "Oceanavigations", "Tigress Enterprises", "Champion Arts", "Pyramidustries" ], "order_date" : "2019-11-25T03:41:46+00:00", "order_id" : 727269, "products" : [ { "base_price" : 74.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Oceanavigations", "tax_amount" : 0, "product_id" : 22880, "category" : "Women's Shoes", "sku" : "ZO0249902499", "taxless_price" : 74.99, "unit_discount_amount" : 0, "min_price" : 35.25, "_id" : "sold_product_727269_22880", "discount_amount" : 0, "created_on" : "2016-12-26T03:41:46+00:00", "product_name" : "Boots - black", "price" : 74.99, "taxful_price" : 74.99, "base_unit_price" : 74.99 }, { "base_price" : 32.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Tigress Enterprises", "tax_amount" : 0, "product_id" : 12484, "category" : "Women's Clothing", "sku" : "ZO0068400684", "taxless_price" : 32.99, "unit_discount_amount" : 0, "min_price" : 17.48, "_id" : "sold_product_727269_12484", "discount_amount" : 0, "created_on" : "2016-12-26T03:41:46+00:00", "product_name" : "Cardigan - black/white", "price" : 32.99, "taxful_price" : 32.99, "base_unit_price" : 32.99 }, { "base_price" : 13.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Champion Arts", "tax_amount" : 0, "product_id" : 21362, "category" : "Women's Clothing", "sku" : "ZO0494704947", "taxless_price" : 13.99, "unit_discount_amount" : 0, "min_price" : 6.58, "_id" : "sold_product_727269_21362", "discount_amount" : 0, "created_on" : "2016-12-26T03:41:46+00:00", "product_name" : "Long sleeved top - blue", "price" : 13.99, "taxful_price" : 13.99, "base_unit_price" : 13.99 }, { "base_price" : 49.99, "discount_percentage" : 0, "quantity" : 1, "manufacturer" : "Pyramidustries", "tax_amount" : 0, "product_id" : 13854, "category" : "Women's Shoes", "sku" : "ZO0143401434", "taxless_price" : 49.99, "unit_discount_amount" : 0, "min_price" : 25.49, "_id" : "sold_product_727269_13854", "discount_amount" : 0, "created_on" : "2016-12-26T03:41:46+00:00", "product_name" : "Lace-up boots - black", "price" : 49.99, "taxful_price" : 49.99, "base_unit_price" : 49.99 } ], "sku" : [ "ZO0249902499", "ZO0068400684", "ZO0494704947", "ZO0143401434" ], "taxful_total_price" : 171.96, "taxless_total_price" : 171.96, "total_quantity" : 4, "total_unique_products" : 4, "type" : "order", "user" : "rabbia", "geoip" : { "country_iso_code" : "AE", "location" : { "lon" : 55.3, "lat" : 25.3 }, "region_name" : "Dubai", "continent_name" : "Asia", "city_name" : "Dubai" } } } ] } } </pre> </div> <p>  相关性的衡量</p> <p>1 Precision(查准率)_尽可能返回较少的无关</p> <p>2 Recall (查全率)_ 尽量返回较多的相关文档</p> <p>3 Ranking—是否能够按照相关匹配度进行排序</p> <p> </p> </div><div class="alert alert-warning" role="alert"><p>来源:<code>https://www.cnblogs.com/rdchenxi/p/11829564.html</code></p></div></div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">标签</div> <div class="field--items"> <div class="field--item"><a href="/tag/date" hreflang="zh-hans">date</a></div> <div class="field--item"><a href="/tag/eddie" hreflang="zh-hans">eddie</a></div> </div> </div> Tue, 03 Dec 2019 19:55:32 +0000 不羁的心 1504696 at https://www.e-learn.cn