mysql全文返回奇数

标签 mysql full-text-search ranking

我正在尝试创建一个搜索工具,它采用一个文本字段,该文本字段可以包含部分或全部标题、一个或多个任意顺序的作者姓名以及摘要中的术语,并试图找到最有可能的出版物用户正在寻找。但是返回的排名是错误的。

即使输入的文本是标题开头的逐字逐句,如果我按 MATCH 结果排序,理想的结果也不会靠近结果顶部。

对于创建准确结果排名的更好解决方案有什么想法吗?

SQL

SELECT `title`, (MATCH (`title`) AGAINST ("Data Trends #55")) AS `rank_title`
FROM `tblPublications`
HAVING (`rank_title`) > 1
  ORDER BY `rank_title`  DESC

数据

title   rank_title 
Data Trends #140: The Role of Data Collection and Evaluation in Supporting Systems Change.  3.2141819000244
Data Trends #70: From Incarceration to Community.   2.7096807956696
Data Trends #12: Under Court Order. 2.7096807956696
Data Trends #78: Inclusion in Schools.  2.7096807956696
Data Trends #43: Paraprofessionals in Educational Settings. 2.6802139282227
Data Trends #35: Respite Care and Outcome.  2.6802139282227
Data Trends #08: Developments in Systems of Care.   2.6802139282227
Data Trends #07: Development of an Outcome Evaluation.  2.6802139282227
Data Trends #03: Families as Researchers and Evaluators.    2.6802139282227
Data Trends #02: Caregiver Enrichment and Stress.   2.6802139282227
Data Trends #97: The Relationships Between Poverty and Psychopathology. 2.6802139282227
Data Trends #111: Stigma and Mental Illness.    2.6802139282227
Data Trends #115: Building on Caregiver Strengths.  2.6802139282227
Data Trends #142: Defining the Wraparound Process.  2.6802139282227
Data Trends #71: Family Interventions in Serious Mental Illness.    2.6513810157776
Data Trends #63: Implementing IDEA '97 Disciplinary Provisions. 2.6513810157776
Data Trends #57: Using the Parents as Partners Principle with SED Children. 2.6513810157776
Data Trends #49: Cultural Competence: Caregiver Perspectives.   2.6513810157776
Data Trends #47: Service Use & Intensive Family Preservation.   2.6513810157776
Data Trends #44: Mood Disorders: Treatment Patterns in an HMO.  2.6513810157776
Data Trends #38: Adolescent Drug Treatment and Outcome. 2.6513810157776
Data Trends #34: Family-Centered Early Intervention.    2.6513810157776
Data Trends #31: Juvenile Justice and Mental Health.    2.6513810157776
Data Trends #25: Children's Mental Health in the Media. 2.6513810157776
Data Trends #18: Attribution in Children's Mental Health.   2.6513810157776
Data Trends #15:  Mechanisms of Change in Multisystemic Therapy.    2.6513810157776
Data Trends #10: Toxic Threats to Child Development.    2.6513810157776
Data Trends #73: Having a Brother with Emotional and/or Behavioral Challenges.  2.6513810157776
Data Trends #74: Research and Advocacy for Policy Change.   2.6513810157776
Data Trends #79: Family Perspectives on Having a Child with a Disability.   2.6513810157776
Data Trends #81: Explaining the Gap Between Mental Health Need and Service Use. 2.6513810157776
Data Trends #91: The Implications of Incarceration for Families and Children.   2.6513810157776
Data Trends #84: Working Relationships across Diverse Communities.  2.6513810157776
Data Trends #86: Community Interventions and Effective Prevention.  2.6513810157776
Data Trends #95: Maternal Employment when Children Have Disabilities.   2.6513810157776
Data Trends #99: Clinicians and How They Use and View Outcome Measurement.  2.6513810157776
Data Trends #108: Practice and Process in Wraparound Teamwork.  2.6513810157776
Data Trends #122: Outcomes for Youth Following Psychiatric Emergencies. 2.6513810157776
Data Trends #133: Evaluating treatment for homeless adolescents 2.6513810157776
Data Trends #156: Assessing the Sustainability of Systems of Care.  2.6513810157776
Data Trends #159: Out-of-Home Placements Within Systems of Care 2.6513810157776
Data Trends #64: Impact of Poverty on Family Quality of Life.   2.6231617927551
Data Trends #54: Mental Health Referral in Juvenile Justice.    2.6231617927551
Data Trends #53: Clinical Profiles of Youth in a System of Care.    2.6231617927551
Data Trends #45: Mood Disorders: Accuracy of Screening Instruments. 2.6231617927551
Data Trends #39: Violence: Emotional & Behavioral Impact & Prevention.  2.6231617927551
Data Trends #37: Racial Differences in Service Placement Patterns.  2.6231617927551
Data Trends #28: Suicidal Ideation, Depression, and Help-Seeking Among Adolescents. 2.6231617927551
Data Trends #26: Foster Care: Importance of Training and Support.   2.6231617927551
Data Trends #24: Needs Assessment and Service Coordination in an Inner City Neighborhood.   2.6231617927551
Data Trends #19: Custody Relinquishment: Impact of Research on Policy.  2.6231617927551
Data Trends #17: Offering Technical Assistance to Native Families.  2.6231617927551
Data Trends #13: Child Abuse and Neglect in Indian Country. 2.6231617927551
Data Trends #05: Consumer Satisfaction with Mental Health Services. 2.6231617927551
Data Trends #76: Community-Based Interventions for Affective Disorders. 2.6231617927551
Data Trends #77: Adolescent Help-Seeking Behavior: Role of the Internet.    2.6231617927551
Data Trends #80: Impact of Support on Adolescent Mental Health. 2.6231617927551
Data Trends #85: Culture-Centered Practice in Services for Children.    2.6231617927551
Data Trends #90: Exposure to Violence, Stress, Protective Factors, and Well-being.  2.6231617927551
Data Trends #92: Depictions of Mental Illness in Children's Media.  2.6231617927551
Data Trends #105: Collective socialization and child conduct problems.  2.6231617927551
Data Trends #116: Domestic Violence and Children's Mental Health.   2.6231617927551
Data Trends #121: Quality and Individualization in Wraparound Team Planning.    2.6231617927551
Data Trends #124: The Stigmatization of Mental Illness in Children and Families.    2.6231617927551
Data Trends #125: Neighborhood Residence and the Problems of School-Age Children.   2.6231617927551
Data Trends #149: What Constitutes Youth Involvement in Systems of Care?    2.6231617927551
Data Trends #151: Are Brothers and Sisters a Good Source of Support?    2.6231617927551
Data Trends #150: Understanding ADHD: Examining Racial Differences. 2.6231617927551
Data Trends #152: Family Participation in Action: Are Families Actually Involved?   2.6231617927551
Data Trends #158: Children's Perspectives of Their Mental Health Services.  2.6231617927551
Data Trends #160: Peer Stigmatization of Childhood Depression and ADHD  2.6231617927551
Data Trends #68: Prevalence of Psychiatric Disorders in Youth in Juvenile Detention.    2.5955367088318
Data Trends #59: Factors Associated with Response Inconsistency in Structured Diagnostic Interviews.    2.5955367088318
Data Trends #55: Mental Health Screening Instruments for use in Juvenile Justice.   2.5955367088318

最佳答案

单词的默认最小长度为四个 described here .有关更改的信息,描述 here .

因此搜索 Data Trends #55 可能等同于 Data Trends。显示的结果集中验证第一行的标题中第二次出现 Data 一词,这可能解释了为什么它排名最高。

关于mysql全文返回奇数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4762452/

相关文章:

python - XGBoost 成对设置 - python

php - 在数据库中插入数组值

mysql - MySQL中关于 'left join'的问题

search - 跨多个表的 MySQL 全文搜索

php - 如何使用 SQL 获取 MySQL 停用词

Python 仅对列表的一部分进行排名

mysql - 创建临时表时出错

mysql - 从终端或 shell 脚本制作 neo4j 命令

java - 全文索引器(或缓存)如何工作?

c# - 社交网络排名算法