<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep xmlns="">
<header>
  <title>Full Text Search in MAM</title>
  <abstract>This specification proposes a field in the MAM form for full text searching.</abstract>
  
<legal>
<copyright>This XMPP Extension Protocol is copyright © 1999 – 2024 by the <link url="https://xmpp.org/">XMPP Standards Foundation</link> (XSF).</copyright>
<permissions>Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.</permissions>
<warranty>## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##</warranty>
<liability>In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.</liability>
<conformance>This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at &lt;<link url="https://xmpp.org/about/xsf/ipr-policy">https://xmpp.org/about/xsf/ipr-policy</link>&gt; or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).</conformance>
</legal>
  <number>0431</number>
  <status>Deferred</status>
  <type>Standards Track</type>
  <sig>Standards</sig>
  <approver>Council</approver>
  <dependencies>
    <spec>XMPP Core</spec>
    <spec>XEP-0313</spec>
  </dependencies>
  <supersedes/>
  <supersededby/>
  <shortname>fulltextmam</shortname>
  
    <author>
      <firstname>Dave</firstname>
      <surname>Cridland</surname>
      <email>dave@hellopando.com</email>
      <jid>dwd@dave.cridland.net</jid>
    </author>

  <revision>
    <version>0.2.0</version>
    <date>2020-01-29</date>
    <initials>dwd</initials>
    <remark>
      <ul>
        <li>No More Beer</li>
        <li>Quasi-normative language around syntactic implementation</li>
      </ul>
    </remark>
  </revision>
  <revision>
    <version>0.1.0</version>
    <date>2020-01-29</date>
    <initials>XEP Editor (jsc)</initials>
    <remark>Accepted by vote of Council on 2020-01-22.</remark>
  </revision>
  <revision>
    <version>0.0.1</version>
    <date>2020-01-21</date>
    <initials>dwd</initials>
    <remark>
      <ul>
        <li>Initial Revision</li>
      </ul>
    </remark>
  </revision>
</header>

<section1 topic="Introduction" anchor="intro">
  <p><span class="ref"><link url="https://xmpp.org/extensions/xep-0313.html">Message Archive Management (XEP-0313)</link></span> <note>XEP-0313: Message Archive Management &lt;<link url="https://xmpp.org/extensions/xep-0313.html">https://xmpp.org/extensions/xep-0313.html</link>&gt;.</note> has an extensible form. This specification extends the extensible form with an extension which extends MAM to perform full text searching. A number of existing implementations of this extension exist - extending their existing extensions to confirm to the extension in this specification now it exists is intended to be trivial.</p>
</section1>

<section1 topic="Overview" anchor="overview">
  <section2 topic="Discovering Support" anchor="feature">
    <p>Support for this protocol is advertised by the Service Discovery protocol defined in <span class="ref"><link url="https://xmpp.org/extensions/xep-0030.html">Service Discovery (XEP-0030)</link></span> <note>XEP-0030: Service Discovery &lt;<link url="https://xmpp.org/extensions/xep-0030.html">https://xmpp.org/extensions/xep-0030.html</link>&gt;.</note> using a feature
      of <tt>urn:xmpp:fulltext:0</tt>.</p>
  </section2>
  <section2 topic="Searching">
    <p>Searching using full text is performed by the client supplying an additional text key, which if non-empty is used as input to a full text search of some form. The precise meaning of this field is left entirely implementation-defined at this time. Future revisions of this specification might impose additional constraints.</p>
  </section2>
</section1>

  <section1 topic="Protocol Elements">
    <section2 topic="Querying">
      <p>A text input field of <tt>{urn:xmpp:fulltext:0}fulltext</tt> is hereby defined for the 'urn:xmpp:mam:2' FORM_TYPE, as conforming to the syntax defined in <span class="ref"><link url="https://xmpp.org/extensions/xep-0068.html">Field Standardization for Data Forms (XEP-0068)</link></span> <note>XEP-0068: Field Data Standardization for Data Forms &lt;<link url="https://xmpp.org/extensions/xep-0068.html">https://xmpp.org/extensions/xep-0068.html</link>&gt;.</note></p>
    </section2>
    <section2 topic="Results">
      <p>The precise matching of the supplied text string is left implementation-defined. Servers MAY use any full-text search mechanism. While this might mean that certain characters are deemed "special", clients are RECOMMENDED not to attempt any support for these, as they are unlikely to be portable between implementations. While many implementations of this protocol might conform in a purely syntactic sense, it is to be noted that the intent is that a reasonable full-text search is performed based on the input - servers SHOULD therefore honour this intent despite the lack of a formal strict definition.</p>
    </section2>
  </section1>

  <section1 topic="Schema">
    <p>Not sure this is needed at all.</p>
  </section1>

<section1 topic="Security Considerations" anchor="security">
  <p>None?</p>
</section1>

<section1 topic="IANA Considerations" anchor="iana">
  <p>This XEP requires no interaction with the <span class="ref"><link url="http://www.iana.org/">Internet Assigned Numbers Authority (IANA)</link></span> <note>The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see &lt;<link url="http://www.iana.org/">http://www.iana.org/</link>&gt;.</note>. </p>
</section1>

<section1 topic="XMPP Registrar Considerations" anchor="registrar">
  <p>Registration of the field pointing to this document.</p>
</section1>

<section1 topic="Acknowledgements" anchor="ack">
  <p>Guus der Kinderen nudged me into doing this. Matthew Wild and Kev Smith argued reasonably that nobody should have to buy beer.</p>
</section1>

</xep>
