当前位置: 首页 > news >正文

租用服务器一般是谁帮助维护网站安全哪个平台做推广效果好

租用服务器一般是谁帮助维护网站安全,哪个平台做推广效果好,c语言自学免费网站,找工程项目电商搜索要点剖析 前言: 由于水平受限,该文章并不能深度去剖析真实电商搜索功能的底层,接下来的部分主要是我根据网页查询ai问答总结而得 希望大家多多包涵,同时也欢迎纠错指正! 各大电商平台的搜索大致可分为三个阶段…

电商搜索要点剖析

前言: 由于水平受限,该文章并不能深度去剖析真实电商搜索功能的底层,接下来的部分主要是我根据网页查询+ai问答总结而得 希望大家多多包涵,同时也欢迎纠错指正!


各大电商平台的搜索大致可分为三个阶段

1.Query理解:对于用户输入的关键字进行纠错、改写、扩展、分词等

2.召回阶段:根据查询词,从商品库中召回有效正确的商品候选集

3.排序阶段:给定召回商品候选集合,根据众多因子对商品排序


京东分享-电商搜索中语义检索与商品排序:https://zhuanlan.zhihu.com/p/465504164
论文:https://arxiv.org/pdf/2006.02282

图 1

淘宝搜索
相关论文:《Embedding-based Product Retrieval in Taobao Search》

图 2

Query理解阶段

目前各大电商搜索基本都应用了NLP(自然语言处理)技术,query阶段主要流程为:拼写纠错–>分词–>类目预测

阶段主要目的使用技术
拼写纠错修正用户拼音/别字/错字编辑距离、拼音映射、语言模型、BERT等
分词将连续文本切成有意义词单元词典分词、CRF、BiLSTM-CRF、BERT等
类目预测识别Query对应的商品类目TextCNN、FastText、BERT分类器、向量匹配

召回阶段

这个阶段主要基于Query阶段进行,如果用户主动选择了商品类目则根据用户所选进行召回,否则按照上一阶段类目预测进行类目筛选

多路召回

召回方式原理举例说明
关键词匹配召回倒排索引,基于分词匹配Query中含“耐克鞋”,命中耐克商品
类目召回通过类目ID匹配商品类目类目预测是“运动鞋”,召回该类商品
属性召回匹配颜色、尺码、功能等属性“夏季防滑”,召回“凉鞋”类商品
品牌召回品牌识别结果匹配商品品牌字段“苹果手机壳”,召回 Apple 的配件
向量召回Query 转成 Embedding 向量“网红同款裙子” → 语义检索相似商品
历史行为召回利用用户画像/点击历史你经常搜“iPhone壳” → 优先相关商品
同义词扩展召回Query改写扩展词匹配商品“牛仔裤”扩展为“牛仔长裤”、“jeans”

多路召回确保了商品尽可能命中,有效避免了搜索商品为空的情况


🧠 举个完整例子
当用户输入:苹果13手机可透明防摔
经过Query处理后得到

  • 品牌:苹果
  • 商品意图:配件->手机壳
  • 属性:透明、防摔
  • 类目预测:手机配件>手机壳

然后召回

通道类型召回商品
关键词召回命中“苹果”、“手机壳”
类目召回所有“手机壳”类目商品
属性召回带有“防摔”、“透明”标签的商品
品牌召回Apple 品牌下的配件
向量召回含有“保护壳”或“壳套”的近义商品

排序阶段

🧱 排序阶段的总体结构:

排序阶段一般会分成 三级排序(粗到精):

初排(粗排) → 精排(主排序) → 重排(个性化/多目标)


1️⃣ 初排(粗排 / pre-ranking)
  • 目的:快速过滤掉明显不相关或低质量商品,减少计算负担
  • 模型:轻量模型(如LR、Tree-based、Wide&Deep)
  • 特征:Query词命中数、类目匹配、价格过滤、是否违规等

2️⃣ 精排(主排序 / ranking)
  • 目的:主力打分,精细评估每个商品的价值

  • 模型:深度学习模型(CTR/CVR预测),如:

    • DNN、DSSM、DIN、DeepFM、Transformer
  • 特征举例

类别特征示例
Query特征Query长度、词性、意图类型
商品特征价格、销量、评价、品牌、库存
用户特征历史兴趣、性别、年龄、最近浏览行为等
用户-商品用户是否点击过该商品、用户是否收藏过等
Query-商品分词重合度、类目相关性、品牌一致性等
  • 目标:最大化CTR(点击率)或 GMV(成交额)

3️⃣ 重排(后排序 / re-ranking)
  • 目的:提升多目标表现,强化个性化、多样性

  • 操作内容

    • 加入冷启动保护、新品扶持、打散重复品牌
    • 引入上下文特征(如用户最近浏览行为)
    • 考虑业务规则:广告插入、黑名单屏蔽、活动优先等

📌 排序还要考虑的特殊场景:

  • 广告排序融合:搜索广告商品会和自然排序混合
  • 新商品冷启动保护:避免因点击少而排序靠后
  • 业务打分融合:平台可以插入指定商品、活动商品

Es+Redis模拟电商搜索

由于技术有限,这里就直接采用ik分词器进行分词,采用es进行模糊匹配,大家要是有更好改进的点可以在评论区分享呀,我也是最近刚学习了Es突发奇想做的小demo,效果在文章末有展示
Github地址:https://github.com/Aeroeia/ElasticSearch 大家要是这样觉得有用的话可以点个小星星呀

缓存搜索结果
同步数据
用户界面
Web服务器
Elasticsearch
Redis缓存
MySQL数据库

环境准备

  • Jdk11+
  • Maven
  • Redis
  • Mysql
  • Elasticsearch 7.x、ik分词器

es索引库结构

PUT /item 
{"settings": {"analysis": {"analyzer": {"suggest_analyzer": {"tokenizer": "keyword","filter": ["lowercase", "trim"]}}}},"mappings": {"properties": {"id": { "type": "keyword" },"name": {"type": "text","analyzer": "ik_max_word" },"brand": { "type": "keyword"},"category": {"type": "keyword"},"suggest_keywords": {"type": "completion","analyzer": "suggest_analyzer","preserve_separators": false,"preserve_position_increments": false},"price": { "type": "integer" , "index": false},"image": { "type": "keyword" , "index": false}}}
}

Mysql中也基本是这些字段,只不过没有suggest_keywords

后端实现(SpringBoot+RestHighLevelClient+SpringCache(Redis))

Maven依赖

    <dependencies><!-- Elasticsearch 客户端 --><dependency><groupId>org.elasticsearch.client</groupId><artifactId>elasticsearch-rest-high-level-client</artifactId><version>7.12.1</version></dependency><!-- 数据库连接池 --><dependency><groupId>com.alibaba</groupId><artifactId>druid-spring-boot-starter</artifactId><version>1.2.1</version></dependency><!-- Redis依赖 --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-redis</artifactId></dependency><!-- MySQL驱动 --><dependency><groupId>com.mysql</groupId><artifactId>mysql-connector-j</artifactId><scope>runtime</scope></dependency><!-- Spring Web --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><!-- Lombok --><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>1.18.30</version></dependency><!-- MyBatis Plus --><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId><version>3.5.6</version></dependency><!-- Spring Boot 基础依赖 --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter</artifactId></dependency><!-- Spring Boot 测试依赖 --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency>
<!--        hutool工具包--><dependency><groupId>cn.hutool</groupId><artifactId>hutool-all</artifactId><version>5.8.11</version></dependency></dependencies>

配置类

@Configuration
public class EsConfiguration {@Beanpublic RestHighLevelClient restHighLevelClient(){return new RestHighLevelClient(RestClient.builder(HttpHost.create("192.168.112.128:9200") //写成自己es的ip端口));}
}

Controller

@RestController
@Slf4j
@RequestMapping("es")
@RequiredArgsConstructor
public class EsController {private final IItemService itemService;//用于获取搜索建议@GetMapping("/suggestions")public List<String> getSuggestions(@RequestParam String keyword){log.info("keyword:{}",keyword);return itemService.getSuggestions(keyword);}//查询商品接口@GetMapping("/search")public List<ItemVO> search(@RequestParam(required = false) String keyword, @RequestParam(required = false) String brand, @RequestParam(required = false) String category){log.info("keyword:{}",keyword);log.info("brand:{}",brand);log.info("category:{}",category);return itemService.search(keyword,brand,category);}
}

ServiceImpl

@Service
@Slf4j
@RequiredArgsConstructor
public class ItemServiceImpl extends ServiceImpl<ItemMapper, Item> implements IItemService {private final RestHighLevelClient client;//自定义字段private final String suggestionName = "sug";@Override@Cacheable(value = "suggestions",key = "#keyword")public List<String> getSuggestions(String keyword) {try {// 构建搜索建议请求SuggestBuilder sb = new SuggestBuilder();sb.addSuggestion(suggestionName,SuggestBuilders.completionSuggestion("suggest_keywords").prefix(keyword).size(10) //最多十条建议.skipDuplicates(true));SearchSourceBuilder src = new SearchSourceBuilder().suggest(sb).size(0);SearchRequest req = new SearchRequest("item").source(src);// 执行搜索SearchResponse resp = client.search(req, RequestOptions.DEFAULT);log.info("搜索响应: {}", resp);// 解析建议结果CompletionSuggestion suggestion = resp.getSuggest().getSuggestion(suggestionName);if (suggestion == null) {log.warn("未找到建议结果");return new ArrayList<>();}List<String> suggestions = suggestion.getOptions().stream().map(option -> {String str = option.getText().toString();//关键词高亮StringBuilder builder = new StringBuilder(str);builder.insert(0,"<em>");builder.insert(keyword.length()+4,"</em>");return builder.toString();}).collect(Collectors.toList());return suggestions;} catch (IOException e) {log.error("搜索建议时发生错误", e);throw new RuntimeException("搜索建议失败", e);}}//同步mysql数据到es@Overridepublic void syncData() {log.info("开始同步数据到ES");List<Item> list = this.list();BulkRequest request = new BulkRequest();for (Item item : list) {try {List<String> suggestions = SuggestionsUtil.getSuggestions(item.getName(), item.getBrand(), item.getCategory());EsItem esItem = BeanUtil.copyProperties(item, EsItem.class);// 构建completion suggester所需的特定格式Map<String, Object> suggest = new HashMap<>();suggest.put("input", suggestions);suggest.put("weight", 10);esItem.setSuggest_keywords(suggest);String jsonString = JSONUtil.toJsonStr(esItem);request.add(new IndexRequest("item").id(item.getId().toString()).source(jsonString, XContentType.JSON));} catch (Exception e) {log.error("处理商品数据时发生错误, ID: {}", item.getId(), e);}}try {client.bulk(request, RequestOptions.DEFAULT);log.info("数据同步完成,共同步 {} 条记录", list.size());} catch (IOException e) {log.error("批量同步数据时发生错误", e);throw new RuntimeException("同步数据失败", e);}}@Override@Cacheable(value = "search",key = "#keyword+'-'+#brand+'-'+#category")public List<ItemVO> search(String keyword, String brand, String category) {SearchRequest request = new SearchRequest("item");//将keyword匹配name、brand、categoryBoolQueryBuilder boolQueryBuilder;if(StrUtil.isNotBlank(keyword)){boolQueryBuilder  = QueryBuilders.boolQuery().must(QueryBuilders.multiMatchQuery(keyword, "name", "brand", "category"));}else{boolQueryBuilder = QueryBuilders.boolQuery().must(QueryBuilders.matchAllQuery());}if(StrUtil.isNotBlank(brand)){boolQueryBuilder.filter(QueryBuilders.termQuery("brand", brand));}if(StrUtil.isNotBlank(category)){boolQueryBuilder.filter(QueryBuilders.termQuery("category", category));}request.source().query(boolQueryBuilder).highlighter(SearchSourceBuilder.highlight().field("name"));request.source().size(10);SearchResponse response;try {response = client.search(request, RequestOptions.DEFAULT);} catch (IOException e) {throw new RuntimeException(e);}SearchHit[] hits = response.getHits().getHits();List<ItemVO> list = new ArrayList<>();for(var hit : hits){Map<String, HighlightField> highlightFields = hit.getHighlightFields();HighlightField highlightField = highlightFields.get("name");String highlight = null;String source = hit.getSourceAsString();ItemVO itemVO = JSONUtil.toBean(source, ItemVO.class);if(highlightField!=null){highlight = highlightField.getFragments()[0].toString();}else{highlight = itemVO.getName();}itemVO.setHighlight(highlight);list.add(itemVO);}return list;}}

生成suggest_keyword工具类


public class SuggestionsUtil {public static List<String> getSuggestions(String name, String brand, String category) {//简单按照名字中空格作为划分区List<String> suggestions = Arrays.stream(name.split("\\s+")).filter(word -> word.length() >= 2).distinct().collect(Collectors.toList());// 将品牌和分类直接加入搜索建议(如果不为空)if (StrUtil.isNotBlank(brand)) {suggestions.add(brand.trim());}if (StrUtil.isNotBlank(category)) {suggestions.add(category.trim());}return suggestions;}
}

SpringTask 定时将mysql数据同步到es

@Component
@RequiredArgsConstructor
public class EsTask {private final IItemService itemService;private final RestHighLevelClient client;@Scheduled(cron = "0 */5 * * * ?") // 每5分钟执行一次public void syncProductToEs() {itemService.syncData();}
}

效果展示


文章转载自:
http://zymosterol.mnqg.cn
http://pollucite.mnqg.cn
http://bedeck.mnqg.cn
http://ssd.mnqg.cn
http://coquina.mnqg.cn
http://vestibulocerebellar.mnqg.cn
http://pingo.mnqg.cn
http://clothes.mnqg.cn
http://uncaused.mnqg.cn
http://plasticene.mnqg.cn
http://whipstock.mnqg.cn
http://salable.mnqg.cn
http://zygomata.mnqg.cn
http://counterdraw.mnqg.cn
http://clavecinist.mnqg.cn
http://heal.mnqg.cn
http://subtilize.mnqg.cn
http://smacksman.mnqg.cn
http://mixtecan.mnqg.cn
http://journeyman.mnqg.cn
http://palaeobotany.mnqg.cn
http://outdoorsman.mnqg.cn
http://finicking.mnqg.cn
http://closed.mnqg.cn
http://neuritis.mnqg.cn
http://permeate.mnqg.cn
http://stash.mnqg.cn
http://cotquean.mnqg.cn
http://prehension.mnqg.cn
http://sulfamethazine.mnqg.cn
http://formicide.mnqg.cn
http://radiosonde.mnqg.cn
http://facebar.mnqg.cn
http://anarchistic.mnqg.cn
http://gcf.mnqg.cn
http://crossbedded.mnqg.cn
http://underpinning.mnqg.cn
http://sanctuary.mnqg.cn
http://rappini.mnqg.cn
http://developer.mnqg.cn
http://unhcr.mnqg.cn
http://overinflated.mnqg.cn
http://biddable.mnqg.cn
http://kilorad.mnqg.cn
http://valera.mnqg.cn
http://laticifer.mnqg.cn
http://hyperbole.mnqg.cn
http://agrestic.mnqg.cn
http://plateresque.mnqg.cn
http://semaphoric.mnqg.cn
http://streaky.mnqg.cn
http://sickish.mnqg.cn
http://shim.mnqg.cn
http://antifederalism.mnqg.cn
http://imageable.mnqg.cn
http://typoscript.mnqg.cn
http://taws.mnqg.cn
http://antipathetic.mnqg.cn
http://woodsman.mnqg.cn
http://fulminic.mnqg.cn
http://chameleonic.mnqg.cn
http://module.mnqg.cn
http://jeff.mnqg.cn
http://decastylos.mnqg.cn
http://envionment.mnqg.cn
http://treacherous.mnqg.cn
http://tarriance.mnqg.cn
http://eaprom.mnqg.cn
http://deerhound.mnqg.cn
http://galax.mnqg.cn
http://gravettian.mnqg.cn
http://cymar.mnqg.cn
http://direct.mnqg.cn
http://morphologist.mnqg.cn
http://initiating.mnqg.cn
http://anaclisis.mnqg.cn
http://sphygmometer.mnqg.cn
http://menses.mnqg.cn
http://bastardry.mnqg.cn
http://chanteuse.mnqg.cn
http://seamark.mnqg.cn
http://devolatilization.mnqg.cn
http://pseudocarp.mnqg.cn
http://chenar.mnqg.cn
http://ita.mnqg.cn
http://beetlehead.mnqg.cn
http://custodian.mnqg.cn
http://lipochrome.mnqg.cn
http://collarbone.mnqg.cn
http://unround.mnqg.cn
http://conductimetric.mnqg.cn
http://woolskin.mnqg.cn
http://quinze.mnqg.cn
http://punctuational.mnqg.cn
http://yokelish.mnqg.cn
http://cryptanalyst.mnqg.cn
http://surefire.mnqg.cn
http://eruption.mnqg.cn
http://quicklime.mnqg.cn
http://oxherd.mnqg.cn
http://www.dt0577.cn/news/81854.html

相关文章:

  • 什么专业就业前景好优化网站seo策略
  • wordpres做影视网站佛山百度seo点击软件
  • 免费软件下载公众号单页应用seo如何解决
  • 网站建设项目必应bing搜索引擎
  • 乐都网站建设企业seddog站长之家
  • 泰安网络网站软件推广是什么工作
  • seo整站优化+WordPress百度关键词推广条件
  • WordPress博客整站带数据seo搜索引擎
  • 下载应用的appseo基础培训
  • 阳江做网站苏州网站
  • 白日梦怎么做的网站百度关键词seo外包
  • 网站栏目策划 有思想的新闻企业如何做网站
  • 做性事的视频网站种子搜索神器 bt 下载
  • 网站开发区网站推广多少钱一年
  • 克隆网站后怎么做宁波网站制作设计
  • 青岛公司做网站的价格网页设计培训
  • 小网站建设公司排名今日百度搜索风云榜
  • 培训网站建设学校seo软件推荐
  • 建做一个av网站seo培训公司
  • 手机微信网页版登录入口seo网站推广免费
  • 网站开发进度设计与阶段目标微帮推广平台怎么加入
  • 商务网站的类型一共有几大类百度今日排行榜
  • 南昌网站建设大全网站代运营价格
  • 经典的响应式布局网站张家界seo
  • 商城展示网站建设百度西安
  • 动态网站开发 PHP一键制作网站
  • 网络营销推广的方式和特点推推蛙seo顾问
  • 建俄语网站网站构建的基本流程
  • 可做生物试卷的网站在线网站建设平台
  • wordpress外贸商城主题东莞seo排名扣费