`
kfcman
  • 浏览: 397108 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

elasticsearch parent-child

 
阅读更多

package com.prime.demo.util;


import java.io.IOException;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.elasticsearch.action.bulk.BulkProcessor;
import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.bulk.BulkRequestBuilder;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.update.UpdateRequest;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.settings.ImmutableSettings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHits;

import com.prime.demo.beans.ESDocument;
import com.prime.demo.multithread.MessageService;
import com.prime.mcms.base.beans.ArticleBean;
import com.prime.mcms.base.utils.DateUtil;
import com.prime.mcms.base.utils.SecurityUtil;
import com.prime.smm.base.beans.TweetDocument;
import com.prime.smm.base.utils.PropConfig;
import com.prime.smm.base.utils.json.JSONArray;
import com.prime.smm.base.utils.json.JSONException;

public class ElasticSearchUtils {
    private static String clusterName = PropConfig.getFileConfig("elasticsearch", "es.clusterName");
    private static String indexname= PropConfig.getFileConfig("elasticsearch", "es.indexname");
    private static String indextype= PropConfig.getFileConfig("elasticsearch", "es.indextype");
    private static String message = MessageService.getInstance(4) ;
    static Map<String, String> m = new HashMap<String, String>();
    // 设置client.transport.sniff为true来使客户端去嗅探整个集群的状态,把集群中其它机器的ip地址加到客户端中,
    static Settings settings = ImmutableSettings.settingsBuilder().put(m).put("cluster.name",clusterName).put("client.transport.sniff", true).build();
    public ElasticSearchUtils() {}
    
    private static TransportClient client;
 
    static {
        try {
            Class<?> clazz = Class.forName(TransportClient.class.getName());
            Constructor<?> constructor = clazz.getDeclaredConstructor(Settings.class);
            constructor.setAccessible(true);
            client = (TransportClient) constructor.newInstance(settings);
            client.addTransportAddress(new InetSocketTransportAddress("192.168.9.103", 9300));
            client.addTransportAddress(new InetSocketTransportAddress("192.168.9.115", 9300));
            client.addTransportAddress(new InetSocketTransportAddress("192.168.9.116", 9300));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
    // 取得实例
    public static synchronized TransportClient getTransportClient() {
        return client;
    }
    
    public static void prepareIndex(){
        IndexResponse response = client.prepareIndex("tweet", "tweet").setSource(message).execute().actionGet();
    }
    
    
    /**
     * 插入数据
     */
    public boolean bulkBuilder(List<ArticleBean> objects,String indexName,String indexType){
        System.out.println(objects.size()) ;
        if(objects!=null && objects.size()>0){
            BulkRequestBuilder bulkRequest = client.prepareBulk();
            for(ArticleBean article : objects){
                System.out.println("--<>"+article.toString()) ;
                IndexRequestBuilder indexRequest = client.prepareIndex(indexName, indexType).setSource(article.toString());
                bulkRequest.add(indexRequest);
            }
            System.out.println(bulkRequest.toString()) ;
            BulkResponse bulkResponse = bulkRequest.execute().actionGet();
            if (bulkResponse.hasFailures()) {
                System.out.println(bulkResponse.buildFailureMessage());
                  return false;
            }
            return true ;
        }
        return false ;
    }
    
    public static void bulkBuilder(){
        BulkRequestBuilder bulkRequest = client.prepareBulk();
        IndexRequestBuilder indexRequest = client.prepareIndex("tweet", "tweet").setSource(message);
        bulkRequest.add(indexRequest);
        BulkResponse bulkResponse = bulkRequest.execute().actionGet();
        if (bulkResponse.hasFailures()) {
            System.out.println(bulkResponse.buildFailureMessage());
        }
    }
    
    
    public static void bulkBuilder(List<TweetDocument> docs){
        if(docs!=null && docs.size()>0){
            BulkRequestBuilder bulkRequest = client.prepareBulk();
            for(TweetDocument tweet:docs){
                IndexRequestBuilder indexRequest = client.prepareIndex("tweet", "tweet").setSource(tweet.toString()).setId(tweet.getFolderDocId());
                bulkRequest.add(indexRequest);
            }
            BulkResponse bulkResponse = bulkRequest.execute().actionGet();
            if (bulkResponse.hasFailures()) {
                System.out.println(bulkResponse.buildFailureMessage());
            }
        }
    }
    
    
    public static void bulkBuilderLists(List<ESDocument> docs){
        long t1 = System.currentTimeMillis();
        if(docs!=null && docs.size()>0){
            BulkRequestBuilder bulkRequest = client.prepareBulk();
            for(ESDocument tweet:docs){
                String tweeString = tweet.toString() ;
                String pMessage = ESDocument.parseParentDocument(tweeString).toString() ;
//                System.out.println("pMessage::"+pMessage) ;
                String cMessage = ESDocument.parseChildDocument(tweeString).toString() ;
//                System.out.println("cMessage::"+cMessage) ;
                IndexRequestBuilder indexRequest = client.prepareIndex("alert", "tweet").setSource(pMessage);
                bulkRequest.add(indexRequest);
                indexRequest = client.prepareIndex("alert", "index").setSource(cMessage).setParent(tweet.getFolderDocId());
                bulkRequest.add(indexRequest);
            }
            BulkResponse bulkResponse = bulkRequest.execute().actionGet();
            if (bulkResponse.hasFailures()) {
                System.out.println(bulkResponse.buildFailureMessage());
            }
        }
        long t2 = System.currentTimeMillis();
        System.out.println("ES index doc size:"+docs.size()+" ,cost:"+(t2-t1)/1000+"s");
    }
    
    
    public static void bulkProcess() {
        BulkProcessor bulkProcessor = BulkProcessor.builder(client,
                new BulkProcessor.Listener() {
                    long a = 0 ;
                    long b = 0 ;
                    public void beforeBulk(long executionId,  BulkRequest request) {
                        a = System.currentTimeMillis() ;
                         System.out.println("beforeBulk numberOfActions = " + request.numberOfActions()+"|request:"+request.requests().size());
                    }
                    public void afterBulk(long executionId, BulkRequest request,  BulkResponse response) {
                        b = System.currentTimeMillis() ;
                        System.out.println("afterBulk"+(b-a)+" ms");
                    }
                    //璁剧疆ConcurrentRequest 涓�锛孴hrowable涓嶆姏閿�
                    public void afterBulk(long executionId, BulkRequest request, Throwable failure) {
//                        System.out.println("happen fail = " + failure.getMessage() + " cause = " +failure.getCause());
                    }
                })
                .setBulkActions(10000)
                .setBulkSize(new ByteSizeValue(20, ByteSizeUnit.MB))
                .setFlushInterval(TimeValue.timeValueSeconds(5))
                .setConcurrentRequests(10)
                .build();
                for(int i=0;i<1000;i++){
                    bulkProcessor.add(new IndexRequest("tweet", "tweet").source(message));
                }
        bulkProcessor.close();
        client.close();
    }
    
    public static void updateIndexRequest(){
        try {
            UpdateRequest updateRequest = new UpdateRequest();
            updateRequest.index("alert");
            updateRequest.type("index");
            updateRequest.parent("tweet");        //parent-child更新必须加上父类
            updateRequest.id("3804792499471673");
            
//            更新ptIds
//            String ptIds = "[{\"catId\":27607,\"catTitle\":\"英菲尼迪\",\"contentMention\":1,\"docId\":\"2015112500000413192\",\"level\":1,\"titleMention\":0,\"treeType\":1}]" ;
//            updateRequest.doc(XContentFactory.jsonBuilder().startObject().field("ptIds", net.sf.json.JSONArray.fromObject(ptIds)).endObject());
            
            updateRequest.doc(XContentFactory.jsonBuilder().startObject().field("activeCount", 123).endObject());
            client.update(updateRequest).get();
            
            
            
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    
    /**
     * 执行搜索
     * @param queryBuilder
     * @param indexname
     * @param type
     * @return
     */
    public static  void searcher(QueryBuilder queryBuilder, String indexname, String type){
        SearchResponse searchResponse = client.prepareSearch(indexname).setTypes(type)
        .setQuery(queryBuilder)
        .execute()
        .actionGet();
        SearchHits hits = searchResponse.getHits() ;
        System.out.println("查询到记录数=" + hits.getTotalHits());
        SearchHit[] searchHists = hits.getHits();
        if(searchHists.length>0){
            for(SearchHit hit:searchHists){
                System.out.println("source:"+hit.getSource().toString()) ;
                String folderDocId = hit.getSource().get("folderDocId")+"";
                System.out.println("folderDocId:"+folderDocId) ;
                String ptIds = hit.getSource().get("ptIds")+"";
                System.out.println("ptIds:"+ptIds) ;
                String dtIds = hit.getSource().get("dtIds")+"";
                System.out.println("dtIds:"+dtIds) ;
                String terms = hit.getSource().get("terms")+"";
                System.out.println("terms:"+terms) ;
            }
        }
    }
    
    
    /**
     * 执行搜索
     * @param queryBuilder
     * @param indexname
     * @param type
     * @return
     */
    public static  void hasChildSearcher(QueryBuilder queryBuilder, String indexname, String type){
        SearchResponse searchResponse = client.prepareSearch(indexname)
        .setQuery(queryBuilder)
        .execute()
        .actionGet();
        SearchHits hits = searchResponse.getHits() ;
        System.out.println("查询到记录数=" + hits.getTotalHits());
        SearchHit[] searchHists = hits.getHits();
        if(searchHists.length>0){
            for(SearchHit hit:searchHists){
                System.out.println("source:"+hit.getSource().toString()) ;
                String folderDocId = hit.getSource().get("folderDocId")+"";
                System.out.println("folderDocId:"+folderDocId) ;
            }
        }
    }
    
    
    public static void main(String[] args) throws IOException {
        String link = "http://club.autohome.com.cn/bbs/brand-58-c-433-100.htm" ;
        ArticleBean articleBean = new ArticleBean();
        articleBean.setContent("测试我的文章内容123");
        articleBean.setTitle("这是我的文章标题");
        articleBean.setAuthorName("付金山");
        articleBean.setLink(link) ;
        articleBean.setPublishDate(DateUtil.date2String(new Date())) ;
        articleBean.setInputTime(DateUtil.date2String(new Date())) ;
        String id = SecurityUtil.SHA1(link);
        articleBean.setSysId(id);
        String projectIds = "[{\"projectId\":27607},{\"projectId\":27605},{\"projectId\":27606}]" ;
        net.sf.json.JSONArray projectJsonArray = new net.sf.json.JSONArray() ;
        if(projectIds!=null && !projectIds.equals("")){
            projectJsonArray = net.sf.json.JSONArray.fromObject(projectIds) ;
        }
        articleBean.setProjectIds(projectJsonArray) ;
        List<ArticleBean> objects= new ArrayList<ArticleBean>() ;
        objects.add(articleBean) ;
        new ElasticSearchUtils().bulkBuilder(objects, "article", "article") ;
        
        
//        ElasticSearchUtils.prepareIndex() ;
//        ElasticSearchUtils.bulkProcess() ;
//        ElasticSearchUtils.bulkBuilder() ;
//        ElasticSearchUtils.updateIndexRequest(); //更新索引
        
        
        /*
         * https://www.elastic.co/guide/en/elasticsearch/guide/current/parent-child-mapping.html
         * http://sense.qbox.io/gist/73f6d2f347a08bfe0c254a977a4a05a68d2f3a8d
         * */
        /**
        XContentBuilder cdoc=XContentFactory.jsonBuilder().startObject().field("b_num_prop",1).field("b_str_prop","部门1").endObject();
        IndexResponse cresponse = client.prepareIndex("company", "branch").setSource(cdoc).setId("1").execute().actionGet();
        System.out.println("branch:"+cresponse.getId()) ;
        XContentBuilder edoc=XContentFactory.jsonBuilder().startObject().field("_parent",1).field("e_child_num",1).field("e_child_str","工号1").endObject();
        IndexResponse eresponse = client.prepareIndex("company", "employee").setSource(edoc).setId("1").execute().actionGet();
        System.out.println("employee:"+eresponse.getId()) ;
        **/
        
        /** 建立父子关联的索引
        List<ESDocument> tweets = new ArrayList<ESDocument>() ;
        tweets.add(ESDocument.arrayTweetDocument(message)) ;
        if(tweets!=null && tweets.size()>0){
            BulkRequestBuilder bulkRequest = client.prepareBulk();
            for(ESDocument tweet:tweets){
                String tweeString = tweet.toString() ;
                String pMessage = ESDocument.parseParentDocument(tweeString).toString() ;
                System.out.println("pMessage:"+pMessage) ;
                String cMessage = ESDocument.parseChildDocument(tweeString).toString() ;
                System.out.println("cMessage:"+cMessage) ;
                IndexRequestBuilder indexRequest = client.prepareIndex("blog", "text").setSource(pMessage);
                bulkRequest.add(indexRequest);
                indexRequest = client.prepareIndex("blog", "index").setSource(cMessage).setParent(tweet.getFolderDocId());
                bulkRequest.add(indexRequest);
            }
            BulkResponse bulkResponse = bulkRequest.execute().actionGet();
            if (bulkResponse.hasFailures()) {
                System.out.println(bulkResponse.buildFailureMessage());
            }
        }
        **/
        /**普通查询
        QueryBuilder queryBuilder = QueryBuilders.boolQuery().must(QueryBuilders.termQuery("blogId", "3822866355643510"));
//        QueryBuilder queryBuilder = QueryBuilders.boolQuery().must(QueryBuilders.termQuery("title", "胆小鬼"));
//        QueryBuilder queryBuilder = QueryBuilders.boolQuery().must(QueryBuilders.queryStringQuery("ptIds.level:2"));  //数组查询
        System.out.println(queryBuilder.toString()) ;
        ElasticSearchUtils.searcher(queryBuilder, "alert", "index") ;
        **/
        
        /** 查询根据子类查询,返回父类结果
        QueryBuilder queryBuilder = QueryBuilders.hasChildQuery("indicators", QueryBuilders.termQuery("blogId","1ee526c4af7372ff04bd4e1d6e4cf872ed6b11a7")) ;
        System.out.println(queryBuilder.toString()) ;
        SearchResponse searchResponse = client.prepareSearch("blog").setTypes("blog").setQuery(queryBuilder).execute().actionGet() ;
        SearchHits hits = searchResponse.getHits() ;
        System.out.println("查询到记录数=" + hits.getTotalHits());
        SearchHit[] searchHists = hits.getHits();
        if(searchHists.length>0){
            for(SearchHit hit:searchHists){
                System.out.println("source:"+hit.getSource().toString()) ;
                String folderDocId = hit.getSource().get("folderDocId")+"";
                String campaignId = hit.getSource().get("campaignId")+"";
                String polar = hit.getSource().get("polar")+"";
                String view = hit.getSource().get("view")+"";
                
                System.out.println("folderDocId:"+folderDocId) ;
                System.out.println("campaignId:"+campaignId) ;
                System.out.println("polar:"+polar) ;
                System.out.println("view:"+view) ;
            }
        }
        **/
        
        /** 查询根据父类查询,返回子类结果
        QueryBuilder queryBuilder = QueryBuilders.hasParentQuery("text", QueryBuilders.boolQuery().must(QueryBuilders.queryStringQuery("terms.attr:67436545"))) ;
        System.out.println(queryBuilder.toString()) ;
        SearchResponse searchResponse = client.prepareSearch("blog").setTypes("index").setQuery(queryBuilder).execute().actionGet() ;
        SearchHits hits = searchResponse.getHits() ;
        System.out.println("查询到记录数=" + hits.getTotalHits());
        SearchHit[] searchHists = hits.getHits();
        if(searchHists.length>0){
            for(SearchHit hit:searchHists){
                System.out.println("source:"+hit.getSource().toString()) ;
                String folderDocId = hit.getSource().get("folderDocId")+"";
                String campaignId = hit.getSource().get("campaignId")+"";
                String polar = hit.getSource().get("polar")+"";
                String view = hit.getSource().get("view")+"";
                
                System.out.println("folderDocId:"+folderDocId) ;
                System.out.println("campaignId:"+campaignId) ;
                System.out.println("polar:"+polar) ;
                System.out.println("view:"+view) ;
            }
        }
        **/
        
        /** 查询根据子类查询,返回父和子类结果 方法一: 获取总数为2
        QueryBuilder queryBuilder = QueryBuilders.indicesQuery(QueryBuilders.termQuery("blogId","3903007903499940"), "indicators") ;
        System.out.println(queryBuilder.toString()) ;
        SearchResponse searchResponse = client.prepareSearch("blog").setQuery(queryBuilder).execute().actionGet() ;
        SearchHits hits = searchResponse.getHits() ;
        System.out.println("查询到记录数=" + hits.getTotalHits());
        SearchHit[] searchHists = hits.getHits();
        if(searchHists.length>0){
            for(SearchHit hit:searchHists){
                System.out.println("source:"+hit.getSource().toString()) ;
                String folderDocId = hit.getSource().get("folderDocId")+"";
                String campaignId = hit.getSource().get("campaignId")+"";
                String polar = hit.getSource().get("polar")+"";
                String view = hit.getSource().get("view")+"";
                
                System.out.println("folderDocId:"+folderDocId) ;
                System.out.println("campaignId:"+campaignId) ;
                System.out.println("polar:"+polar) ;
                System.out.println("view:"+view) ;
            }
        }
       */
        
        /** 查询根据子类查询,返回父和子类结果 方法二: 获取总数为1
        QueryBuilder queryBuilder = QueryBuilders.hasChildQuery("indicators", QueryBuilders.termQuery("blogId","1ee526c4af7372ff04bd4e1d6e4cf872ed6b11a7")).innerHit(new QueryInnerHitBuilder()) ; ;
        System.out.println(queryBuilder.toString()) ;
        SearchResponse searchResponse = client.prepareSearch("blog").setTypes("blog").setQuery(queryBuilder).execute().actionGet() ;
        SearchHits hits = searchResponse.getHits() ;
        System.out.println("blog indicators 查询到记录数=" + hits.getTotalHits());
        SearchHit[] searchHists = hits.getHits();
        if(searchHists.length>0){
            for(SearchHit hit:searchHists){
                System.out.println("source:"+hit.getSource().toString()) ;
                System.out.println("getInnerHits:"+hit.getInnerHits().toString()) ;
                String folderDocId = hit.getSource().get("folderDocId")+"";
                String campaignId = hit.getSource().get("campaignId")+"";
                System.out.println("folderDocId:"+folderDocId) ;
                System.out.println("campaignId:"+campaignId) ;
                
                Map<String, SearchHits> innerHits = hit.getInnerHits();
                SearchHits innerHit  = innerHits.get("indicators");
                System.out.println("indicators 查询到记录数=" + innerHit.getTotalHits());
                SearchHit[] searchinnerHits = innerHit.getHits();
                if(searchinnerHits.length>0){
                     for(SearchHit inner:searchinnerHits){
                         String polar = inner.getSource().get("polar")+"";
                         String view = inner.getSource().get("view")+"";
                         System.out.println("polar:"+polar) ;
                         System.out.println("view:"+view) ;
                     }
                }
            }
        }
        **/
        
      /**组合分组查询
      SearchResponse sr = client.prepareSearch("blog").setTypes("blog").setQuery(QueryBuilders.matchAllQuery())
                   .addAggregation(AggregationBuilders.terms("1").field("mediaType"))
                   .execute().actionGet();
      org.elasticsearch.search.aggregations.bucket.terms.Terms a = sr.getAggregations().get("1");
      for(org.elasticsearch.search.aggregations.bucket.terms.Terms.Bucket bk:a.getBuckets()){
        System.out.println("类型: "+bk.getKey()+"  分组统计数量 "+bk.getDocCount()+"  ");
      }
      System.out.println("聚合数量:"+a.getBuckets().size());
      **/
    /**组合分组查询 http://www.nosqldb.cn/1393917706416.html
    SearchResponse response = client.prepareSearch("blog").setTypes("blog")
            .addAggregation(AggregationBuilders.terms("terms")
                    .field("mediaType"))
            .execute().actionGet();
    Terms terms = response.getAggregations().get("terms");
    for(org.elasticsearch.search.aggregations.bucket.terms.Terms.Bucket b:terms.getBuckets()){
        System.out.println("filedname:"+b.getKey()+"docCount:"+b.getDocCount());
    }
     **/
        
    /**    facet查询 http://www.chepoo.com/elasticsearch-facet-search-example.html
     String eSql = "*:*" ;
     QueryBuilder queryBuilder = QueryBuilders.queryStringQuery(eSql) ;
     SearchResponse searchResponse = client.prepareSearch("blog")
                   .setTypes("blog")
                   .addFacet(FacetBuilders.termsFacet("termFacet").fields("mediaType"))
                   .setQuery(queryBuilder)
                   .execute().actionGet() ;
     TermsFacet f = (TermsFacet) searchResponse.getFacets().facetsAsMap().get("termFacet");
     f.getTotalCount();      // Total terms doc count
     f.getOtherCount();      // Not shown terms doc count
     f.getMissingCount();    // Without term doc count   
     
     for (TermsFacet.Entry entry : f) {
         System.out.println(entry.getTerm() +"    count:"+entry.getCount());
         //entry.getTerm()为catid,分类id
         //entry.getCount()为该分类下的数量
     }
     **/
    }
}

分享到:
评论

相关推荐

    elasticsearch 自制 join 插件

    在这个特定的场景中,我们关注的是一个自定义的"elasticsearch join 插件",这个插件是基于Elasticsearch的parent-child关系进行改进的,新增了字段join功能。 在Elasticsearch原生的parent-child关系中,数据被...

    Elasticsearch Server - Third Edition

    Boost the searching capabilities of your system through synonyms, multilingual data handling, nested objects and parent-child documents Deep dive into the world of data aggregation and data analysis ...

    分布式搜索 elasticsearch 方案研究 - 基础知识

    分布式搜索是现代大数据处理的关键技术之一,而Elasticsearch作为其中的佼佼者,因其高效、灵活和可扩展性而广泛应用于各种场景。本篇将深入探讨Elasticsearch的基础知识,涵盖其核心概念、环境搭建、配置管理以及...

    一站式掌握elastic search基础与实战视频资源-百度云链接

    09-6 -nested_vs_parent_child.avi 09-7 -reindex.avi 09-8 其他建议.avi 10-1 生产环境部署建议.avi 10-2 写性能优化.avi 10-3 读性能优化.avi 10-4 如何设定shard数.avi 10-5 xpack监控功能介绍.avi 11-1 入门及...

    elasticsearch-grails-plugin-sample:grails 弹性搜索插件的示例应用程序

    Elasticsearch Grails 插件 - 示例应用Elasticsearch Grails 插件的示例应用程序。 插件主页由 Noam Y. Tenne 维护并托管在 。为什么? 如果您习惯了 grails 但从未使用过 ,那么安装插件后您可能会有点迷茫。 ...

    京东架构师的ES笔记分享.docx

    - **parent-child文档关系处理**:讲解如何在Elasticsearch中建立和查询parent-child文档关系,适用于某些特定的数据模型。 - **脚本使用**:介绍如何使用脚本来执行复杂的逻辑操作,如动态计算字段值等。 #### 第...

    ElasticSearch Java 中文文档 5.6

    ElasticSearch是一款基于Lucene构建的开源搜索引擎,它提供了分布式的全文搜索功能,常用于大数据量的实时搜索场景。ElasticSearch 5.6版的Java API中文文档是针对Java开发者使用ElasticSearch的指导手册,它不仅...

    es-extension-api:使用API​​进行下载

    GET /parent-index/_left{ "query": { "match": { "productName": "상품 조회" } }, "from": 0, "size": 10000, "join": { "index": "child-index", "parent": "bundleKey", "child": "bundleKey", "query": { "mat...

    jQuery完全实例.rar

    jQuery1.2 API 中文版折叠展开折叠全部展开全部 英文说明 核心jQuery 核心函数 jQuery(expression,[context]) jQuery(expression,[context]) 这个函数接收一个包含 CSS 选择器的字符串,然后用这个字符串去匹配一组...

    贵州省遵义市桐梓县七年级英语上册Unit2Thisismysister第3课时导学案无答案新版人教新目标版.doc

    - 有些名词复数形式有特殊变化,例如:child--children,mouse--mice,man--men,woman--women。 通过以上知识点的学习,学生应该能够更熟练地谈论自己的家庭,构建和理解 Family Tree,并掌握如何在句子中正确...

    Parent education vs. child psychotherapy

    The author has charged in a previous article that child psychotherapy is es- sentially an expensive illusion with regard to the great majority of children referred to private therapists and to ...

    2019秋七年级英语上册Unit2ThisismysisterSectionB1a_1d导学案无答案新版人教新目标版201912

    - 特殊的不规则变化,如child-&gt;children,man-&gt;men,woman-&gt;women 通过这些知识点的学习,学生能够更熟练地表达和讨论家庭成员,增强语言表达的丰富性和准确性,同时也能增进对中西方家庭文化差异的理解。

    可数名词单数变复数练习题.doc

    parent -&gt; parents;mother -&gt; mothers;father -&gt; fathers;sister -&gt; sisters;brother -&gt; brothers;son -&gt; sons;daughter -&gt; daughters;case -&gt; cases;box -&gt; boxes;card -&gt; cards;family -&gt; families。 ...

    开放英语1形成性考核册答案(中央广播电视大学外语部).知识.pdf

    1. 名词复数形式:名词变复数有固定规则,如一般情况下加-s(parent -&gt; parents),以s、x、ch、sh结尾的加-es(bus -&gt; buses),以元音+y结尾的变y为i再加-es(child -&gt; children),不规则名词变化(life -&gt; lives...

    class-generator-es5

    console.log('Log from parent constructor'); }, { foo: function() { return 42; } }); var ChildClass = CG(function() { console.log('Log from child constructor'); }, { getMeaning: function() { ...

    新人教七年级上册英语UnitPPT课件.pptx

    - 规则变化:一般情况下,名词在词尾加 `-s` 或 `-es` 形成复数,例如 `book -&gt; books`。 - 不规则变化:某些名词有特殊的复数形式,如 `man -&gt; men`, `child -&gt; children`。 - 复合名词变复数:如果名词由两个词...

    html-css-booleaner:Es布林纳15-03-2021

    div.parent div.child { /* 选择父div下的子div */ } /* 使用逻辑运算符 or */ .button.primary, .button.secondary { /* 选择类为primary或secondary的按钮 */ } ``` 通过学习和分析这个项目的源代码,你可以...

    js代码-es5组合继承

    在这个例子中,`Child`类通过`Parent.call(this, name)`继承了`Parent`类的属性,同时`Child.prototype`指向了`Parent.prototype`的一个新副本,从而继承了`Parent`类的方法。这种方式既保留了父类的实例属性,又...

    js代码-实现原生类继承

    Child.prototype = Object.create(Parent.prototype); Child.prototype.constructor = Child; var child = new Child(); console.log(child.name); // 输出 "parent" ``` 2. **构造函数继承**:通过在子类...

Global site tag (gtag.js) - Google Analytics